@atlaskit/navigation-system 2.9.0 → 2.10.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 +10 -0
- package/constellation/index/examples.mdx +2 -1
- package/dist/cjs/ui/page-layout/root.js +6 -2
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +5 -0
- package/dist/cjs/ui/page-layout/side-nav/toggle-button.js +4 -1
- package/dist/cjs/ui/page-layout/side-nav/visibility-provider.js +11 -2
- package/dist/es2019/ui/page-layout/root.js +5 -2
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +5 -0
- package/dist/es2019/ui/page-layout/side-nav/toggle-button.js +4 -1
- package/dist/es2019/ui/page-layout/side-nav/visibility-provider.js +11 -2
- package/dist/esm/ui/page-layout/root.js +6 -2
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +5 -0
- package/dist/esm/ui/page-layout/side-nav/toggle-button.js +4 -1
- package/dist/esm/ui/page-layout/side-nav/visibility-provider.js +11 -2
- package/dist/types/ui/page-layout/root.d.ts +13 -1
- package/dist/types/ui/page-layout/side-nav/side-nav.d.ts +7 -0
- package/dist/types/ui/page-layout/side-nav/toggle-button.d.ts +7 -0
- package/dist/types/ui/page-layout/side-nav/visibility-provider.d.ts +2 -1
- package/dist/types-ts4.5/ui/page-layout/root.d.ts +13 -1
- package/dist/types-ts4.5/ui/page-layout/side-nav/side-nav.d.ts +7 -0
- package/dist/types-ts4.5/ui/page-layout/side-nav/toggle-button.d.ts +7 -0
- package/dist/types-ts4.5/ui/page-layout/side-nav/visibility-provider.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`8c5f4864d7d4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8c5f4864d7d4c) -
|
|
8
|
+
Adds `defaultSideNavCollapsed` prop to `Root` which replaces the `defaultCollapsed` props on
|
|
9
|
+
`SideNav` and `SideNavToggleButton`. This prop is enabled behind the
|
|
10
|
+
`platform_dst_nav4_full_height_sidebar_api_changes` feature gate. When this gate is cleaned up the
|
|
11
|
+
`defaultCollapsed` props will be removed.
|
|
12
|
+
|
|
3
13
|
## 2.9.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -31,7 +31,8 @@ For ready-made navigation experiences see
|
|
|
31
31
|
|
|
32
32
|
- <a href="https://go.atlassian.com/nav4-interactive-example" target="_blank">
|
|
33
33
|
Full screen interactive example
|
|
34
|
-
</a>
|
|
34
|
+
</a>
|
|
35
|
+
(only available for Atlassian employees at this stage).
|
|
35
36
|
|
|
36
37
|
## Related
|
|
37
38
|
|
|
@@ -35,7 +35,9 @@ function Root(_ref) {
|
|
|
35
35
|
UNSAFE_dangerouslyHoistSlotSizes = _ref$UNSAFE_dangerous === void 0 ? false : _ref$UNSAFE_dangerous,
|
|
36
36
|
_ref$skipLinksLabel = _ref.skipLinksLabel,
|
|
37
37
|
skipLinksLabel = _ref$skipLinksLabel === void 0 ? 'Skip to:' : _ref$skipLinksLabel,
|
|
38
|
-
testId = _ref.testId
|
|
38
|
+
testId = _ref.testId,
|
|
39
|
+
_ref$defaultSideNavCo = _ref.defaultSideNavCollapsed,
|
|
40
|
+
defaultSideNavCollapsed = _ref$defaultSideNavCo === void 0 ? false : _ref$defaultSideNavCo;
|
|
39
41
|
var ref = (0, _react.useRef)(null);
|
|
40
42
|
(0, _react.useEffect)(function () {
|
|
41
43
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -50,7 +52,9 @@ function Root(_ref) {
|
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
}, []);
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(_visibilityProvider.SideNavVisibilityProvider,
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_visibilityProvider.SideNavVisibilityProvider, {
|
|
56
|
+
defaultCollapsed: defaultSideNavCollapsed
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_toggleButtonProvider.SideNavToggleButtonProvider, null, /*#__PURE__*/_react.default.createElement(_elementContext.SideNavElementProvider, null, /*#__PURE__*/_react.default.createElement(_topNavStartContextProvider.TopNavStartProvider, null, /*#__PURE__*/_react.default.createElement(_openLayerObserver.OpenLayerObserver, null, /*#__PURE__*/_react.default.createElement(_hoistSlotSizesContext.DangerouslyHoistSlotSizes.Provider, {
|
|
54
58
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
55
59
|
}, /*#__PURE__*/_react.default.createElement(_skipLinksProvider.SkipLinksProvider, {
|
|
56
60
|
label: skipLinksLabel,
|
|
@@ -247,6 +247,11 @@ function SideNavInternal(_ref) {
|
|
|
247
247
|
trigger: 'click-outside-on-mobile'
|
|
248
248
|
});
|
|
249
249
|
(0, _react.useEffect)(function () {
|
|
250
|
+
if ((0, _platformFeatureFlags.fg)('platform_dst_nav4_full_height_sidebar_api_changes')) {
|
|
251
|
+
// We are passing initial state to the Root now, so no initial sync is required
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
250
255
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
251
256
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
252
257
|
setSideNavState({
|
|
@@ -53,7 +53,10 @@ var SideNavToggleButton = exports.SideNavToggleButton = function SideNavToggleBu
|
|
|
53
53
|
}),
|
|
54
54
|
isSideNavExpandedOnDesktop = _useSideNavVisibility.isExpandedOnDesktop,
|
|
55
55
|
isSideNavExpandedOnMobile = _useSideNavVisibility.isExpandedOnMobile;
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
// When `platform_dst_nav4_full_height_sidebar_api_changes` is enabled,
|
|
58
|
+
// we default to the desktop state for SSR
|
|
59
|
+
var _useState = (0, _react.useState)((0, _platformFeatureFlags.fg)('platform_dst_nav4_full_height_sidebar_api_changes') ? isSideNavExpandedOnDesktop : !defaultCollapsed),
|
|
57
60
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
58
61
|
isSideNavExpanded = _useState2[0],
|
|
59
62
|
setIsSideNavExpanded = _useState2[1];
|
|
@@ -8,15 +8,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.SideNavVisibilityProvider = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _visibilityContext = require("./visibility-context");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
14
|
/**
|
|
14
15
|
* Manages the side nav visibility state and provides the context.
|
|
15
16
|
*/
|
|
16
17
|
var SideNavVisibilityProvider = exports.SideNavVisibilityProvider = function SideNavVisibilityProvider(_ref) {
|
|
17
|
-
var children = _ref.children
|
|
18
|
+
var children = _ref.children,
|
|
19
|
+
defaultCollapsed = _ref.defaultCollapsed;
|
|
20
|
+
var initialState = (0, _platformFeatureFlags.fg)('platform_dst_nav4_full_height_sidebar_api_changes') ? {
|
|
21
|
+
desktop: defaultCollapsed ? 'collapsed' : 'expanded',
|
|
22
|
+
mobile: 'collapsed',
|
|
23
|
+
flyout: 'closed',
|
|
24
|
+
lastTrigger: null
|
|
25
|
+
} : null;
|
|
26
|
+
|
|
18
27
|
// Defaults to null so we can determine if the value has been set yet (for SSR)
|
|
19
|
-
var _useState = (0, _react.useState)(
|
|
28
|
+
var _useState = (0, _react.useState)(initialState),
|
|
20
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
30
|
sideNavState = _useState2[0],
|
|
22
31
|
setSideNavState = _useState2[1];
|
|
@@ -25,7 +25,8 @@ export function Root({
|
|
|
25
25
|
xcss,
|
|
26
26
|
UNSAFE_dangerouslyHoistSlotSizes = false,
|
|
27
27
|
skipLinksLabel = 'Skip to:',
|
|
28
|
-
testId
|
|
28
|
+
testId,
|
|
29
|
+
defaultSideNavCollapsed = false
|
|
29
30
|
}) {
|
|
30
31
|
const ref = useRef(null);
|
|
31
32
|
useEffect(() => {
|
|
@@ -50,7 +51,9 @@ This message will not be displayed in production.
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}, []);
|
|
53
|
-
return /*#__PURE__*/React.createElement(SideNavVisibilityProvider,
|
|
54
|
+
return /*#__PURE__*/React.createElement(SideNavVisibilityProvider, {
|
|
55
|
+
defaultCollapsed: defaultSideNavCollapsed
|
|
56
|
+
}, /*#__PURE__*/React.createElement(SideNavToggleButtonProvider, null, /*#__PURE__*/React.createElement(SideNavElementProvider, null, /*#__PURE__*/React.createElement(TopNavStartProvider, null, /*#__PURE__*/React.createElement(OpenLayerObserver, null, /*#__PURE__*/React.createElement(DangerouslyHoistSlotSizes.Provider, {
|
|
54
57
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
55
58
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
56
59
|
label: skipLinksLabel,
|
|
@@ -230,6 +230,11 @@ function SideNavInternal({
|
|
|
230
230
|
trigger: 'click-outside-on-mobile'
|
|
231
231
|
});
|
|
232
232
|
useEffect(() => {
|
|
233
|
+
if (fg('platform_dst_nav4_full_height_sidebar_api_changes')) {
|
|
234
|
+
// We are passing initial state to the Root now, so no initial sync is required
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
233
238
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
234
239
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
235
240
|
setSideNavState({
|
|
@@ -44,7 +44,10 @@ export const SideNavToggleButton = ({
|
|
|
44
44
|
} = useSideNavVisibility({
|
|
45
45
|
defaultCollapsed
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
// When `platform_dst_nav4_full_height_sidebar_api_changes` is enabled,
|
|
49
|
+
// we default to the desktop state for SSR
|
|
50
|
+
const [isSideNavExpanded, setIsSideNavExpanded] = useState(fg('platform_dst_nav4_full_height_sidebar_api_changes') ? isSideNavExpandedOnDesktop : !defaultCollapsed);
|
|
48
51
|
const ref = useContext(SideNavToggleButtonAttachRef);
|
|
49
52
|
const elementRef = useRef(null);
|
|
50
53
|
useEffect(() => {
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { SetSideNavVisibilityState, SideNavVisibilityState } from './visibility-context';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Manages the side nav visibility state and provides the context.
|
|
6
7
|
*/
|
|
7
8
|
export const SideNavVisibilityProvider = ({
|
|
8
|
-
children
|
|
9
|
+
children,
|
|
10
|
+
defaultCollapsed
|
|
9
11
|
}) => {
|
|
12
|
+
const initialState = fg('platform_dst_nav4_full_height_sidebar_api_changes') ? {
|
|
13
|
+
desktop: defaultCollapsed ? 'collapsed' : 'expanded',
|
|
14
|
+
mobile: 'collapsed',
|
|
15
|
+
flyout: 'closed',
|
|
16
|
+
lastTrigger: null
|
|
17
|
+
} : null;
|
|
18
|
+
|
|
10
19
|
// Defaults to null so we can determine if the value has been set yet (for SSR)
|
|
11
|
-
const [sideNavState, setSideNavState] = useState(
|
|
20
|
+
const [sideNavState, setSideNavState] = useState(initialState);
|
|
12
21
|
return /*#__PURE__*/React.createElement(SideNavVisibilityState.Provider, {
|
|
13
22
|
value: sideNavState
|
|
14
23
|
}, /*#__PURE__*/React.createElement(SetSideNavVisibilityState.Provider, {
|
|
@@ -27,7 +27,9 @@ export function Root(_ref) {
|
|
|
27
27
|
UNSAFE_dangerouslyHoistSlotSizes = _ref$UNSAFE_dangerous === void 0 ? false : _ref$UNSAFE_dangerous,
|
|
28
28
|
_ref$skipLinksLabel = _ref.skipLinksLabel,
|
|
29
29
|
skipLinksLabel = _ref$skipLinksLabel === void 0 ? 'Skip to:' : _ref$skipLinksLabel,
|
|
30
|
-
testId = _ref.testId
|
|
30
|
+
testId = _ref.testId,
|
|
31
|
+
_ref$defaultSideNavCo = _ref.defaultSideNavCollapsed,
|
|
32
|
+
defaultSideNavCollapsed = _ref$defaultSideNavCo === void 0 ? false : _ref$defaultSideNavCo;
|
|
31
33
|
var ref = useRef(null);
|
|
32
34
|
useEffect(function () {
|
|
33
35
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -42,7 +44,9 @@ export function Root(_ref) {
|
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
}, []);
|
|
45
|
-
return /*#__PURE__*/React.createElement(SideNavVisibilityProvider,
|
|
47
|
+
return /*#__PURE__*/React.createElement(SideNavVisibilityProvider, {
|
|
48
|
+
defaultCollapsed: defaultSideNavCollapsed
|
|
49
|
+
}, /*#__PURE__*/React.createElement(SideNavToggleButtonProvider, null, /*#__PURE__*/React.createElement(SideNavElementProvider, null, /*#__PURE__*/React.createElement(TopNavStartProvider, null, /*#__PURE__*/React.createElement(OpenLayerObserver, null, /*#__PURE__*/React.createElement(DangerouslyHoistSlotSizes.Provider, {
|
|
46
50
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
47
51
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
48
52
|
label: skipLinksLabel,
|
|
@@ -238,6 +238,11 @@ function SideNavInternal(_ref) {
|
|
|
238
238
|
trigger: 'click-outside-on-mobile'
|
|
239
239
|
});
|
|
240
240
|
useEffect(function () {
|
|
241
|
+
if (fg('platform_dst_nav4_full_height_sidebar_api_changes')) {
|
|
242
|
+
// We are passing initial state to the Root now, so no initial sync is required
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
242
247
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
243
248
|
setSideNavState({
|
|
@@ -44,7 +44,10 @@ export var SideNavToggleButton = function SideNavToggleButton(_ref) {
|
|
|
44
44
|
}),
|
|
45
45
|
isSideNavExpandedOnDesktop = _useSideNavVisibility.isExpandedOnDesktop,
|
|
46
46
|
isSideNavExpandedOnMobile = _useSideNavVisibility.isExpandedOnMobile;
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
// When `platform_dst_nav4_full_height_sidebar_api_changes` is enabled,
|
|
49
|
+
// we default to the desktop state for SSR
|
|
50
|
+
var _useState = useState(fg('platform_dst_nav4_full_height_sidebar_api_changes') ? isSideNavExpandedOnDesktop : !defaultCollapsed),
|
|
48
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
52
|
isSideNavExpanded = _useState2[0],
|
|
50
53
|
setIsSideNavExpanded = _useState2[1];
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { SetSideNavVisibilityState, SideNavVisibilityState } from './visibility-context';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Manages the side nav visibility state and provides the context.
|
|
7
8
|
*/
|
|
8
9
|
export var SideNavVisibilityProvider = function SideNavVisibilityProvider(_ref) {
|
|
9
|
-
var children = _ref.children
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
defaultCollapsed = _ref.defaultCollapsed;
|
|
12
|
+
var initialState = fg('platform_dst_nav4_full_height_sidebar_api_changes') ? {
|
|
13
|
+
desktop: defaultCollapsed ? 'collapsed' : 'expanded',
|
|
14
|
+
mobile: 'collapsed',
|
|
15
|
+
flyout: 'closed',
|
|
16
|
+
lastTrigger: null
|
|
17
|
+
} : null;
|
|
18
|
+
|
|
10
19
|
// Defaults to null so we can determine if the value has been set yet (for SSR)
|
|
11
|
-
var _useState = useState(
|
|
20
|
+
var _useState = useState(initialState),
|
|
12
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
22
|
sideNavState = _useState2[0],
|
|
14
23
|
setSideNavState = _useState2[1];
|
|
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
|
|
|
9
9
|
* The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
|
|
10
10
|
* @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
|
|
11
11
|
*/
|
|
12
|
-
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, }: {
|
|
12
|
+
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, }: {
|
|
13
13
|
/**
|
|
14
14
|
* For rendering the layout areas, e.g. TopNav, SideNav, Main.
|
|
15
15
|
* They should be rendered as immediate children.
|
|
@@ -35,4 +35,16 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
|
|
|
35
35
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
36
36
|
*/
|
|
37
37
|
testId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
40
|
+
*
|
|
41
|
+
* It is always collapsed by default for mobile screens.
|
|
42
|
+
*
|
|
43
|
+
* This value is used when the side nav is first mounted, but you should continuously update your
|
|
44
|
+
* persisted state using the `onCollapse` and `onExpand` callbacks, to ensure it is up to date
|
|
45
|
+
* when the app is reloaded.
|
|
46
|
+
*
|
|
47
|
+
* __Note:__ This prop will only work when the `platform_dst_nav4_full_height_sidebar_api_changes` gate is enabled.
|
|
48
|
+
*/
|
|
49
|
+
defaultSideNavCollapsed?: boolean;
|
|
38
50
|
}): JSX.Element;
|
|
@@ -12,6 +12,13 @@ type SideNavProps = CommonSlotProps & {
|
|
|
12
12
|
*/
|
|
13
13
|
label?: string;
|
|
14
14
|
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
*
|
|
17
|
+
* This prop is being replaced by `defaultSideNavCollapsed` on the `Root` element,
|
|
18
|
+
* and will be removed after `platform_dst_nav4_full_height_sidebar_api_changes` is cleaned up.
|
|
19
|
+
*
|
|
20
|
+
* ---
|
|
21
|
+
*
|
|
15
22
|
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
16
23
|
*
|
|
17
24
|
* It is always collapsed by default for mobile screens.
|
|
@@ -14,6 +14,13 @@ export type SideNavVisibilityChangeAnalyticsAttributes = {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const SideNavToggleButton: ({ defaultCollapsed, expandLabel, collapseLabel, testId, interactionName, onClick, }: {
|
|
16
16
|
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*
|
|
19
|
+
* This prop is being replaced by `defaultSideNavCollapsed` on the `Root` element,
|
|
20
|
+
* and will be removed after `platform_dst_nav4_full_height_sidebar_api_changes` is cleaned up.
|
|
21
|
+
*
|
|
22
|
+
* ---
|
|
23
|
+
*
|
|
17
24
|
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
18
25
|
*
|
|
19
26
|
* It is always collapsed by default for mobile screens.
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Manages the side nav visibility state and provides the context.
|
|
4
4
|
*/
|
|
5
|
-
export declare const SideNavVisibilityProvider: ({ children }: {
|
|
5
|
+
export declare const SideNavVisibilityProvider: ({ children, defaultCollapsed, }: {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
defaultCollapsed: boolean;
|
|
7
8
|
}) => React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
|
|
|
9
9
|
* The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
|
|
10
10
|
* @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
|
|
11
11
|
*/
|
|
12
|
-
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, }: {
|
|
12
|
+
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, }: {
|
|
13
13
|
/**
|
|
14
14
|
* For rendering the layout areas, e.g. TopNav, SideNav, Main.
|
|
15
15
|
* They should be rendered as immediate children.
|
|
@@ -35,4 +35,16 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
|
|
|
35
35
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
36
36
|
*/
|
|
37
37
|
testId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
40
|
+
*
|
|
41
|
+
* It is always collapsed by default for mobile screens.
|
|
42
|
+
*
|
|
43
|
+
* This value is used when the side nav is first mounted, but you should continuously update your
|
|
44
|
+
* persisted state using the `onCollapse` and `onExpand` callbacks, to ensure it is up to date
|
|
45
|
+
* when the app is reloaded.
|
|
46
|
+
*
|
|
47
|
+
* __Note:__ This prop will only work when the `platform_dst_nav4_full_height_sidebar_api_changes` gate is enabled.
|
|
48
|
+
*/
|
|
49
|
+
defaultSideNavCollapsed?: boolean;
|
|
38
50
|
}): JSX.Element;
|
|
@@ -12,6 +12,13 @@ type SideNavProps = CommonSlotProps & {
|
|
|
12
12
|
*/
|
|
13
13
|
label?: string;
|
|
14
14
|
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
*
|
|
17
|
+
* This prop is being replaced by `defaultSideNavCollapsed` on the `Root` element,
|
|
18
|
+
* and will be removed after `platform_dst_nav4_full_height_sidebar_api_changes` is cleaned up.
|
|
19
|
+
*
|
|
20
|
+
* ---
|
|
21
|
+
*
|
|
15
22
|
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
16
23
|
*
|
|
17
24
|
* It is always collapsed by default for mobile screens.
|
|
@@ -14,6 +14,13 @@ export type SideNavVisibilityChangeAnalyticsAttributes = {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const SideNavToggleButton: ({ defaultCollapsed, expandLabel, collapseLabel, testId, interactionName, onClick, }: {
|
|
16
16
|
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*
|
|
19
|
+
* This prop is being replaced by `defaultSideNavCollapsed` on the `Root` element,
|
|
20
|
+
* and will be removed after `platform_dst_nav4_full_height_sidebar_api_changes` is cleaned up.
|
|
21
|
+
*
|
|
22
|
+
* ---
|
|
23
|
+
*
|
|
17
24
|
* Whether the side nav should be collapsed by default __on desktop screens__.
|
|
18
25
|
*
|
|
19
26
|
* It is always collapsed by default for mobile screens.
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Manages the side nav visibility state and provides the context.
|
|
4
4
|
*/
|
|
5
|
-
export declare const SideNavVisibilityProvider: ({ children }: {
|
|
5
|
+
export declare const SideNavVisibilityProvider: ({ children, defaultCollapsed, }: {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
defaultCollapsed: boolean;
|
|
7
8
|
}) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/button": "^23.4.0",
|
|
72
72
|
"@atlaskit/css": "^0.14.0",
|
|
73
73
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
74
|
-
"@atlaskit/icon": "^28.
|
|
74
|
+
"@atlaskit/icon": "^28.2.0",
|
|
75
75
|
"@atlaskit/layering": "^3.0.0",
|
|
76
76
|
"@atlaskit/logo": "^19.7.0",
|
|
77
77
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@atlaskit/page-header": "^12.1.0",
|
|
112
112
|
"@atlaskit/page-layout": "^4.2.0",
|
|
113
113
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
114
|
-
"@atlaskit/select": "^21.
|
|
114
|
+
"@atlaskit/select": "^21.3.0",
|
|
115
115
|
"@atlaskit/skeleton": "^2.1.0",
|
|
116
116
|
"@atlaskit/temp-nav-app-icons": "^0.10.0",
|
|
117
117
|
"@atlaskit/textfield": "^8.0.0",
|