@atlaskit/side-navigation 1.7.1 → 1.8.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/dist/cjs/components/Item/go-back-item.js +1 -1
- package/dist/cjs/components/NestingItem/index.js +1 -1
- package/dist/cjs/components/SideNavigation/index.js +4 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Item/go-back-item.js +1 -1
- package/dist/es2019/components/NestingItem/index.js +1 -1
- package/dist/es2019/components/SideNavigation/index.js +4 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Item/go-back-item.js +1 -1
- package/dist/esm/components/NestingItem/index.js +1 -1
- package/dist/esm/components/SideNavigation/index.js +4 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/common/constants.d.ts +2 -0
- package/dist/types-ts4.5/common/styles.d.ts +11 -0
- package/dist/types-ts4.5/components/Footer/index.d.ts +28 -0
- package/dist/types-ts4.5/components/Header/index.d.ts +55 -0
- package/dist/types-ts4.5/components/Item/button-item.d.ts +14 -0
- package/dist/types-ts4.5/components/Item/custom-item.d.ts +14 -0
- package/dist/types-ts4.5/components/Item/go-back-item.d.ts +14 -0
- package/dist/types-ts4.5/components/Item/index.d.ts +10 -0
- package/dist/types-ts4.5/components/Item/link-item.d.ts +16 -0
- package/dist/types-ts4.5/components/Item/skeleton-item.d.ts +13 -0
- package/dist/types-ts4.5/components/LoadingItems/index.d.ts +35 -0
- package/dist/types-ts4.5/components/NavigationContent/index.d.ts +25 -0
- package/dist/types-ts4.5/components/NavigationContent/styles.d.ts +91 -0
- package/dist/types-ts4.5/components/NavigationFooter/index.d.ts +16 -0
- package/dist/types-ts4.5/components/NavigationHeader/index.d.ts +16 -0
- package/dist/types-ts4.5/components/NestableNavigationContent/context.d.ts +24 -0
- package/dist/types-ts4.5/components/NestableNavigationContent/index.d.ts +74 -0
- package/dist/types-ts4.5/components/NestableNavigationContent/nesting-motion.d.ts +22 -0
- package/dist/types-ts4.5/components/NestingItem/hack-for-ert.d.ts +2 -0
- package/dist/types-ts4.5/components/NestingItem/index.d.ts +91 -0
- package/dist/types-ts4.5/components/NestingItem/styles.d.ts +28 -0
- package/dist/types-ts4.5/components/Section/heading-item.d.ts +11 -0
- package/dist/types-ts4.5/components/Section/index.d.ts +6 -0
- package/dist/types-ts4.5/components/Section/section.d.ts +34 -0
- package/dist/types-ts4.5/components/Section/skeleton-heading-item.d.ts +12 -0
- package/dist/types-ts4.5/components/SideNavigation/index.d.ts +32 -0
- package/dist/types-ts4.5/components/index.d.ts +22 -0
- package/dist/types-ts4.5/components/utils/hooks.d.ts +5 -0
- package/dist/types-ts4.5/index.d.ts +4 -0
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/side-navigation
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d518f0e34b9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d518f0e34b9) - [ux] We are testing a selected indicator change to menu, dropdown-menu, and side-navigation packages behind an internal feature flag. If successful this will be released in a later minor release.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 1.7.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -47,7 +47,7 @@ var GoBackItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
47
47
|
onClick && onClick(e);
|
|
48
48
|
}, [onClick, isInteracted]);
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_buttonItem.default, (0, _extends2.default)({
|
|
50
|
-
isSelected: isSelected
|
|
50
|
+
isSelected: isSelected
|
|
51
51
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
52
52
|
,
|
|
53
53
|
cssFn: cssFn,
|
|
@@ -130,7 +130,7 @@ var NestingItem = function NestingItem(props) {
|
|
|
130
130
|
label: ""
|
|
131
131
|
}))),
|
|
132
132
|
onClick: onClickHandler,
|
|
133
|
-
isSelected: isSelected
|
|
133
|
+
isSelected: isSelected,
|
|
134
134
|
testId: testId && "".concat(testId, "--item")
|
|
135
135
|
}, rest), {}, {
|
|
136
136
|
children: title,
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _react2 = require("@emotion/react");
|
|
9
|
+
var _menu = require("@atlaskit/menu");
|
|
9
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
10
11
|
/** @jsx jsx */
|
|
11
12
|
|
|
@@ -40,7 +41,9 @@ var SideNavigation = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
40
41
|
"data-testid": testId,
|
|
41
42
|
"aria-label": label,
|
|
42
43
|
css: sideNavStyles
|
|
43
|
-
},
|
|
44
|
+
}, (0, _react2.jsx)(_menu.SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
45
|
+
value: "notch"
|
|
46
|
+
}, children));
|
|
44
47
|
});
|
|
45
48
|
var _default = SideNavigation;
|
|
46
49
|
exports.default = _default;
|
package/dist/cjs/version.json
CHANGED
|
@@ -31,7 +31,7 @@ const GoBackItem = /*#__PURE__*/forwardRef(({
|
|
|
31
31
|
onClick && onClick(e);
|
|
32
32
|
}, [onClick, isInteracted]);
|
|
33
33
|
return /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
34
|
-
isSelected: isSelected
|
|
34
|
+
isSelected: isSelected
|
|
35
35
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
36
36
|
,
|
|
37
37
|
cssFn: cssFn,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
4
5
|
import { N10, N500 } from '@atlaskit/theme/colors';
|
|
5
6
|
const sidebarMinWidth = '240px';
|
|
6
7
|
const sideNavStyles = css({
|
|
@@ -35,6 +36,8 @@ const SideNavigation = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
35
36
|
"data-testid": testId,
|
|
36
37
|
"aria-label": label,
|
|
37
38
|
css: sideNavStyles
|
|
38
|
-
},
|
|
39
|
+
}, jsx(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
40
|
+
value: "notch"
|
|
41
|
+
}, children));
|
|
39
42
|
});
|
|
40
43
|
export default SideNavigation;
|
package/dist/es2019/version.json
CHANGED
|
@@ -37,7 +37,7 @@ var GoBackItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
37
37
|
onClick && onClick(e);
|
|
38
38
|
}, [onClick, isInteracted]);
|
|
39
39
|
return /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
40
|
-
isSelected: isSelected
|
|
40
|
+
isSelected: isSelected
|
|
41
41
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
42
42
|
,
|
|
43
43
|
cssFn: cssFn,
|
|
@@ -121,7 +121,7 @@ var NestingItem = function NestingItem(props) {
|
|
|
121
121
|
label: ""
|
|
122
122
|
}))),
|
|
123
123
|
onClick: onClickHandler,
|
|
124
|
-
isSelected: isSelected
|
|
124
|
+
isSelected: isSelected,
|
|
125
125
|
testId: testId && "".concat(testId, "--item")
|
|
126
126
|
}, rest), {}, {
|
|
127
127
|
children: title,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
4
5
|
import { N10, N500 } from '@atlaskit/theme/colors';
|
|
5
6
|
var sidebarMinWidth = '240px';
|
|
6
7
|
var sideNavStyles = css({
|
|
@@ -33,6 +34,8 @@ var SideNavigation = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
34
|
"data-testid": testId,
|
|
34
35
|
"aria-label": label,
|
|
35
36
|
css: sideNavStyles
|
|
36
|
-
},
|
|
37
|
+
}, jsx(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
38
|
+
value: "notch"
|
|
39
|
+
}, children));
|
|
37
40
|
});
|
|
38
41
|
export default SideNavigation;
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSFn, StatelessCSSFn } from '@atlaskit/menu';
|
|
2
|
+
/**
|
|
3
|
+
* Allows chaining of style functions on top of base style functions
|
|
4
|
+
* @param baseStyle the base custom cssFn
|
|
5
|
+
* @param newStyle a new cssFn to be applied after the base style
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
|
|
8
|
+
*/
|
|
9
|
+
export declare const overrideStyleFunction: <TState>(baseStyle: CSSFn<TState>, newStyle?: CSSFn<TState> | undefined) => CSSFn<TState>;
|
|
10
|
+
export declare const baseSideNavItemStyle: CSSFn;
|
|
11
|
+
export declare const sectionHeaderSpacingStyles: StatelessCSSFn;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeaderProps } from '../Header';
|
|
3
|
+
type NewFooterProps = Omit<HeaderProps, 'cssFn' | 'component' | 'onClick'>;
|
|
4
|
+
type FooterFacadeProps = (HeaderProps & {
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* @deprecated
|
|
8
|
+
*/
|
|
9
|
+
useDeprecatedApi?: true;
|
|
10
|
+
}) | (NewFooterProps & {
|
|
11
|
+
/**
|
|
12
|
+
* @private
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
15
|
+
useDeprecatedApi?: false;
|
|
16
|
+
cssFn?: never;
|
|
17
|
+
component?: never;
|
|
18
|
+
onClick?: never;
|
|
19
|
+
});
|
|
20
|
+
export type FooterProps = HeaderProps | NewFooterProps;
|
|
21
|
+
/**
|
|
22
|
+
* __Footer__
|
|
23
|
+
*
|
|
24
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
25
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
26
|
+
*/
|
|
27
|
+
declare const FooterFacade: ({ useDeprecatedApi, description, iconBefore, testId, children, component, cssFn, onClick, }: FooterFacadeProps) => JSX.Element;
|
|
28
|
+
export default FooterFacade;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CSSFn, CustomItemComponentProps } from '@atlaskit/menu';
|
|
3
|
+
/**
|
|
4
|
+
* __Container__
|
|
5
|
+
*
|
|
6
|
+
* A container for Header and Footer that safely handles props to the child component
|
|
7
|
+
*/
|
|
8
|
+
export declare const Container: React.FC<CustomItemComponentProps>;
|
|
9
|
+
export type HeaderProps = {
|
|
10
|
+
/**
|
|
11
|
+
* A function that can be used to override the styles of the component.
|
|
12
|
+
* It receives the current styles and state and expects a styles object.
|
|
13
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
|
|
14
|
+
*/
|
|
15
|
+
cssFn?: CSSFn;
|
|
16
|
+
/**
|
|
17
|
+
* Element to render before the item text.
|
|
18
|
+
* Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
|
|
19
|
+
*/
|
|
20
|
+
iconBefore?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Event that is triggered when the element is clicked.
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Description of the item.
|
|
27
|
+
* This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
|
|
28
|
+
*/
|
|
29
|
+
description?: string | JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Primary content for the item.
|
|
32
|
+
*/
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* A `testId` prop is provided for specified elements,
|
|
36
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
37
|
+
* serving as a hook for automated tests.
|
|
38
|
+
*/
|
|
39
|
+
testId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom component to render as an item.
|
|
42
|
+
* This can be both a functional component or a class component.
|
|
43
|
+
* __Will return `null` if no component is defined.__
|
|
44
|
+
* __NOTE:__ Make sure the reference for this component does not change between renders else undefined behavior may happen.
|
|
45
|
+
*/
|
|
46
|
+
component?: React.ComponentType<CustomItemComponentProps>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* __Header__
|
|
50
|
+
*
|
|
51
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
52
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
53
|
+
*/
|
|
54
|
+
declare const Header: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLElement>>;
|
|
55
|
+
export default Header;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { ButtonItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Button item__
|
|
6
|
+
*
|
|
7
|
+
* A button item renders an item wrapped in a button tag, used primarily when an
|
|
8
|
+
* action does something other than changing routes.
|
|
9
|
+
*
|
|
10
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#button-item)
|
|
11
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
12
|
+
*/
|
|
13
|
+
declare const ButtonItem: React.ForwardRefExoticComponent<ButtonItemProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
export default ButtonItem;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
|
|
4
|
+
interface CustomItemPropsHack {
|
|
5
|
+
<TComponentProps extends {}>(props: CustomItemProps<TComponentProps> & {
|
|
6
|
+
ref?: any;
|
|
7
|
+
} & Omit<TComponentProps, keyof CustomItemComponentProps>): JSX.Element | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Used to support any custom items needed by products alongside the Header and Footer patterns.
|
|
11
|
+
* Specific implementation of headers and footers are provided in the examples folder.
|
|
12
|
+
*/
|
|
13
|
+
declare const CustomItem: CustomItemPropsHack;
|
|
14
|
+
export default CustomItem;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { ButtonItemProps as GoBackItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Go back item__
|
|
6
|
+
*
|
|
7
|
+
* A go back item is used to provide a customized "go back" button in nested
|
|
8
|
+
* navigations.
|
|
9
|
+
*
|
|
10
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#go-back-item)
|
|
11
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
12
|
+
*/
|
|
13
|
+
declare const GoBackItem: React.ForwardRefExoticComponent<ButtonItemProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
export default GoBackItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as ButtonItem } from './button-item';
|
|
2
|
+
export type { ButtonItemProps } from './button-item';
|
|
3
|
+
export { default as CustomItem } from './custom-item';
|
|
4
|
+
export type { CustomItemProps, CustomItemComponentProps } from './custom-item';
|
|
5
|
+
export { default as GoBackItem } from './go-back-item';
|
|
6
|
+
export type { GoBackItemProps } from './go-back-item';
|
|
7
|
+
export { default as LinkItem } from './link-item';
|
|
8
|
+
export type { LinkItemProps } from './link-item';
|
|
9
|
+
export { default as SkeletonItem } from './skeleton-item';
|
|
10
|
+
export type { SkeletonItemProps } from './skeleton-item';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { LinkItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Link item__
|
|
6
|
+
*
|
|
7
|
+
* Renders an item wrapped in an anchor tag, useful when you have an item that
|
|
8
|
+
* should change routes using native browser navigation. For SPA transitions use
|
|
9
|
+
* a [custom item](https://atlassian.design/components/side-navigation/examples#custom-item)
|
|
10
|
+
* with the respective router logic.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#link-item)
|
|
13
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
14
|
+
*/
|
|
15
|
+
declare const LinkItem: React.ForwardRefExoticComponent<LinkItemProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
export default LinkItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SkeletonItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { SkeletonItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Skeleton item__
|
|
6
|
+
*
|
|
7
|
+
* A skeleton item can be used to reduce the perceived loading time.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#loading)
|
|
10
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
11
|
+
*/
|
|
12
|
+
declare const SkeletonItem: (props: SkeletonItemProps) => JSX.Element | null;
|
|
13
|
+
export default SkeletonItem;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface LoadingItemsProps {
|
|
3
|
+
/**
|
|
4
|
+
* Child items that will be loaded asynchronously.
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Fallback you want to show when loading.
|
|
9
|
+
* You'll want to use the supplied [skeleton item](/packages/navigation/side-navigation/docs/skeleton-item)
|
|
10
|
+
* or [skeleton heading item](/packages/navigation/side-navigation/docs/skeleton-heading-item) components.
|
|
11
|
+
*/
|
|
12
|
+
fallback: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Used to show either the loading fallback or the loaded contents.
|
|
15
|
+
* Will cross fade between children and fallback when this is flipped.
|
|
16
|
+
*/
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A `testId` prop is provided for specified elements,
|
|
20
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
21
|
+
* serving as a hook for automated tests.
|
|
22
|
+
*
|
|
23
|
+
* Will set these elements when defined:
|
|
24
|
+
* - The entering container - `{testId}--entering`
|
|
25
|
+
* - The exiting container - `{testId}--exiting`
|
|
26
|
+
*/
|
|
27
|
+
testId?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* __Loading items__
|
|
31
|
+
*
|
|
32
|
+
* Loading items conditionally render based on the useShouldNestedElementRender() hook.
|
|
33
|
+
*/
|
|
34
|
+
declare const LoadingItems: ({ children, isLoading, fallback, testId, }: LoadingItemsProps) => JSX.Element;
|
|
35
|
+
export default LoadingItems;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export interface NavigationContentProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Forces the top scroll indicator to be shown all the time.
|
|
7
|
+
*/
|
|
8
|
+
showTopScrollIndicator?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A `testId` prop is provided for specified elements,
|
|
11
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
12
|
+
* serving as a hook for automated tests.
|
|
13
|
+
*/
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* __Navigation content__
|
|
18
|
+
*
|
|
19
|
+
* A navigation content is used as the container for navigation items.
|
|
20
|
+
*
|
|
21
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#content)
|
|
22
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
23
|
+
*/
|
|
24
|
+
declare const NavigationContent: import("react").ForwardRefExoticComponent<NavigationContentProps & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
25
|
+
export default NavigationContent;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
interface StyleOpts {
|
|
2
|
+
showTopScrollIndicator?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* This outer container css contains the "real" scroll indicators which are
|
|
6
|
+
* always rendered to the screen.
|
|
7
|
+
* They are "conditionally" shown from the users perspective using the inner container CSS
|
|
8
|
+
* which has other pseudo elements which "mask" the "real" scroll indicators.
|
|
9
|
+
*/
|
|
10
|
+
export declare const outerContainerCSS: (opts: StyleOpts & {
|
|
11
|
+
scrollbarWidth: number;
|
|
12
|
+
}) => {
|
|
13
|
+
readonly display: "flex";
|
|
14
|
+
readonly height: "100%";
|
|
15
|
+
readonly overflow: "hidden";
|
|
16
|
+
readonly position: "relative";
|
|
17
|
+
readonly '&::before': {
|
|
18
|
+
readonly content: "''";
|
|
19
|
+
readonly display: "block";
|
|
20
|
+
readonly left: 8;
|
|
21
|
+
readonly right: number;
|
|
22
|
+
readonly height: 2;
|
|
23
|
+
readonly borderRadius: 1;
|
|
24
|
+
readonly backgroundColor: "var(--ds-menu-seperator-color, var(--ds-border))";
|
|
25
|
+
readonly position: "absolute";
|
|
26
|
+
readonly zIndex: 1;
|
|
27
|
+
};
|
|
28
|
+
readonly '&::after': {
|
|
29
|
+
readonly content: "''";
|
|
30
|
+
readonly position: "absolute";
|
|
31
|
+
readonly display: "block";
|
|
32
|
+
readonly borderRadius: 1;
|
|
33
|
+
readonly flexShrink: 0;
|
|
34
|
+
readonly height: 2;
|
|
35
|
+
readonly left: 8;
|
|
36
|
+
readonly right: number;
|
|
37
|
+
readonly bottom: 0;
|
|
38
|
+
readonly zIndex: 1;
|
|
39
|
+
readonly backgroundColor: "var(--ds-menu-seperator-color, var(--ds-border))";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* This inner container css contains the "mask" logic for the scroll indicators.
|
|
44
|
+
* Essentially they cover (mask) the "real" scroll indicators when the user is scrolled
|
|
45
|
+
* to the top or bottom of the container.
|
|
46
|
+
*/
|
|
47
|
+
export declare const innerContainerCSS: (opts: StyleOpts) => {
|
|
48
|
+
readonly '&::after': {
|
|
49
|
+
readonly borderRadius: 1;
|
|
50
|
+
readonly content: "''";
|
|
51
|
+
readonly display: "block";
|
|
52
|
+
readonly flexShrink: 0;
|
|
53
|
+
readonly height: 2;
|
|
54
|
+
readonly marginTop: "auto";
|
|
55
|
+
readonly position: "relative";
|
|
56
|
+
readonly zIndex: 2;
|
|
57
|
+
readonly backgroundColor: "var(--ds-menu-scroll-indicator-color, var(--ds-surface))";
|
|
58
|
+
};
|
|
59
|
+
readonly '&::before'?: {
|
|
60
|
+
readonly borderRadius: 1;
|
|
61
|
+
readonly content: "''";
|
|
62
|
+
readonly left: 0;
|
|
63
|
+
readonly right: 0;
|
|
64
|
+
readonly height: 2;
|
|
65
|
+
readonly backgroundColor: "var(--ds-menu-scroll-indicator-color, var(--ds-surface))";
|
|
66
|
+
readonly position: "absolute";
|
|
67
|
+
readonly display: "block";
|
|
68
|
+
readonly zIndex: 2;
|
|
69
|
+
} | undefined;
|
|
70
|
+
readonly display: "flex";
|
|
71
|
+
readonly overflow: "auto";
|
|
72
|
+
readonly width: "100%";
|
|
73
|
+
readonly position: "relative";
|
|
74
|
+
readonly boxSizing: "border-box";
|
|
75
|
+
readonly flexDirection: "column";
|
|
76
|
+
};
|
|
77
|
+
export declare const containerCSS: (opts: StyleOpts) => {
|
|
78
|
+
readonly marginTop: 0 | 2;
|
|
79
|
+
readonly marginLeft: "var(--ds-space-100)";
|
|
80
|
+
readonly marginRight: "var(--ds-space-100)";
|
|
81
|
+
readonly position: "relative";
|
|
82
|
+
readonly '& [data-ds--menu--heading-item]': {
|
|
83
|
+
readonly marginBottom: "var(--ds-space-075)";
|
|
84
|
+
readonly marginTop: "var(--ds-space-200)";
|
|
85
|
+
};
|
|
86
|
+
readonly '& [data-ds--menu--skeleton-heading-item]': {
|
|
87
|
+
readonly marginTop: number;
|
|
88
|
+
readonly marginBottom: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface NavigationFooterProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* __Navigation footer__
|
|
9
|
+
*
|
|
10
|
+
* Allows for customisation of the footer.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
13
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
14
|
+
*/
|
|
15
|
+
declare const NavigationFooter: ({ children }: NavigationFooterProps) => jsx.JSX.Element;
|
|
16
|
+
export default NavigationFooter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface NavigationHeaderProps {
|
|
5
|
+
children: JSX.Element | JSX.Element[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* __Navigation header__
|
|
9
|
+
*
|
|
10
|
+
* Allows for customisation of the header.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
13
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
14
|
+
*/
|
|
15
|
+
declare const NavigationHeader: (props: NavigationHeaderProps) => jsx.JSX.Element;
|
|
16
|
+
export default NavigationHeader;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
interface NestedContext {
|
|
3
|
+
currentStackId: string;
|
|
4
|
+
onNest: (id: string) => void;
|
|
5
|
+
onUnNest: () => void;
|
|
6
|
+
stack: string[];
|
|
7
|
+
parentId: string;
|
|
8
|
+
backButton?: React.ReactNode;
|
|
9
|
+
childIds: MutableRefObject<Set<string>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const NestedContext: import("react").Context<NestedContext | undefined>;
|
|
15
|
+
export declare const useNestedContext: () => NestedContext;
|
|
16
|
+
/**
|
|
17
|
+
* Used by children of the NestableNavigationContent component to see if they should render or not.
|
|
18
|
+
* If `shouldRender` returns `true` - return your nodes.
|
|
19
|
+
* If it returns `false` - either return `null` or `children` if you have children.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useShouldNestedElementRender: () => {
|
|
22
|
+
shouldRender: boolean;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
export declare const ROOT_ID = "ATLASKIT_NESTED_ROOT";
|
|
4
|
+
export interface NestableNavigationContentProps {
|
|
5
|
+
/**
|
|
6
|
+
* The NestableNavigationContent wraps the entire navigation hierarchy of a side-navigation.
|
|
7
|
+
* Using this component is only needed if you want to enable nested views with [nesting items](/packages/navigation/side-navigation/docs/nesting-item),
|
|
8
|
+
* else you should use [navigation content](/packages/navigation/side-navigation/docs/navigation-content) instead.
|
|
9
|
+
*/
|
|
10
|
+
children: JSX.Element | JSX.Element[];
|
|
11
|
+
/**
|
|
12
|
+
* A `testId` prop is provided for specified elements,
|
|
13
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
14
|
+
* serving as a hook for automated tests.
|
|
15
|
+
*
|
|
16
|
+
* Will set these elements when defined:
|
|
17
|
+
* - This wrapper - `{testId}`
|
|
18
|
+
* - The back item (displayed when inside a nested view) - `{testId}--go-back-item`
|
|
19
|
+
*/
|
|
20
|
+
testId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Array of the initial stack you want to show.
|
|
23
|
+
* Useful when wanting to set the initial nested view but not wanting to opt into controlled state.
|
|
24
|
+
* Make sure to have all intermediate navigation pages line up.
|
|
25
|
+
*/
|
|
26
|
+
initialStack?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Enables you to control the stack of navigation views you want to show.
|
|
29
|
+
* Do not jump between controlled and uncontrolled else undefined behaviour will occur.
|
|
30
|
+
* This means either using `initialStack` OR `stack` but not both.
|
|
31
|
+
* Make sure your stack array has a stable reference and does not change between renders.
|
|
32
|
+
*/
|
|
33
|
+
stack?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Allows you to react based on transitions between [nesting items](/packages/navigation/side-navigation/docs/nesting-item).
|
|
36
|
+
* It will be called everytime a user navigates from one [nesting item](/packages/navigation/side-navigation/docs/nesting-item) to another,
|
|
37
|
+
* both up or down the navigation hierarchy.
|
|
38
|
+
* This prop should be used with the `stack` prop for controlled behavior.
|
|
39
|
+
*/
|
|
40
|
+
onChange?: (stack: string[]) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Called when a nesting id that does not exist among `<NestingItem>`s is pushed to the stack. Use this callback to be notified when there is an undefined nesting state.
|
|
43
|
+
* Provides you with the stack which led to the undefined state, with the top of the stack (last item in array) being the invalid item.
|
|
44
|
+
*/
|
|
45
|
+
onUnknownNest?: (stack: string[]) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Custom overrides for the composed components.
|
|
48
|
+
*
|
|
49
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
|
|
50
|
+
*/
|
|
51
|
+
overrides?: {
|
|
52
|
+
/**
|
|
53
|
+
* Use this to override the default back button displayed when navigation is nested.
|
|
54
|
+
* You'll want to import the [go back item](/packages/navigation/docs/go-back-item) component and use it here.
|
|
55
|
+
* This will be displayed for all children [nesting items](/packages/navigation/side-navigation/docs/nesting-item) unless they define their own.
|
|
56
|
+
*/
|
|
57
|
+
GoBackItem?: {
|
|
58
|
+
render?: (props: {
|
|
59
|
+
onClick: () => void;
|
|
60
|
+
testId?: string;
|
|
61
|
+
}) => React.ReactNode;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* __Nestable navigation content__
|
|
67
|
+
*
|
|
68
|
+
* The container for navigation items with nested views
|
|
69
|
+
*
|
|
70
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#nested-navigation)
|
|
71
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
72
|
+
*/
|
|
73
|
+
declare const NestableNavigationContent: (props: NestableNavigationContentProps) => jsx.JSX.Element;
|
|
74
|
+
export default NestableNavigationContent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Ref } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Direction } from '@atlaskit/motion';
|
|
5
|
+
interface ChildrenAsFunctionProps {
|
|
6
|
+
'data-enter-from': string;
|
|
7
|
+
'data-exit-to': string;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
ref: Ref<any>;
|
|
11
|
+
}
|
|
12
|
+
interface NestingMotionProps {
|
|
13
|
+
enterFrom: Direction;
|
|
14
|
+
exitTo: Direction;
|
|
15
|
+
children: (props: ChildrenAsFunctionProps) => React.ReactNode;
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const NestingMotion: (props: NestingMotionProps) => jsx.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CSSFn, CustomItemComponentProps, Overrides } from '@atlaskit/menu';
|
|
4
|
+
interface NestingItemOverrides extends Overrides {
|
|
5
|
+
/**
|
|
6
|
+
* Use this to override the back button displayed when navigation is nested.
|
|
7
|
+
* You'll want to import the [go back item](/packages/navigation/side-navigation/docs/go-back-item) component and use it here.
|
|
8
|
+
* This will be displayed for all children nesting item components unless they define their own.
|
|
9
|
+
*/
|
|
10
|
+
GoBackItem?: {
|
|
11
|
+
render?: (props: {
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
testId?: string;
|
|
14
|
+
}) => React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface NestingItemProps<TCustomComponentProps = CustomItemComponentProps> {
|
|
18
|
+
/**
|
|
19
|
+
* A **unique identifier** for the nesting item.
|
|
20
|
+
* Every nesting item component needs a unique id else undefined behavior will occur.
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Text to display when the nesting item is rendered as a interactable element.
|
|
25
|
+
*/
|
|
26
|
+
title: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The view that should be shown when this nesting item is visible.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Used to customize the rendered component when shown as an item.
|
|
33
|
+
* You can use this for example to change it to a SPA link.
|
|
34
|
+
*/
|
|
35
|
+
component?: React.ComponentType<TCustomComponentProps>;
|
|
36
|
+
/**
|
|
37
|
+
* A `testId` prop is provided for specified elements,
|
|
38
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
39
|
+
* serving as a hook for automated tests.
|
|
40
|
+
*
|
|
41
|
+
* Will set these elements when defined:
|
|
42
|
+
* - The container - `{testId}--container`
|
|
43
|
+
* - The nesting item - `{testId}--item`
|
|
44
|
+
* - The go back item - `{testId}--go-back-item` (only used if you pass in a override).
|
|
45
|
+
* - The nesting item default right arrow icon - `{testId}--item--right-arrow`
|
|
46
|
+
*/
|
|
47
|
+
testId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* A function that can be used to override the styles of the component.
|
|
50
|
+
* It receives the current styles and state and expects a styles object.
|
|
51
|
+
*/
|
|
52
|
+
cssFn?: CSSFn;
|
|
53
|
+
/**
|
|
54
|
+
* Element to render before the item text.
|
|
55
|
+
* Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
|
|
56
|
+
*/
|
|
57
|
+
iconBefore?: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Element to render after the item text.
|
|
60
|
+
* Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
|
|
61
|
+
*/
|
|
62
|
+
iconAfter?: React.ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* Event that is triggered when the element is clicked.
|
|
65
|
+
*/
|
|
66
|
+
onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Description of the item.
|
|
69
|
+
* This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
|
|
70
|
+
*/
|
|
71
|
+
description?: string | JSX.Element;
|
|
72
|
+
/**
|
|
73
|
+
* Makes the element appear disabled as well as removing interactivity.
|
|
74
|
+
*/
|
|
75
|
+
isDisabled?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Makes the element appear selected.
|
|
78
|
+
*/
|
|
79
|
+
isSelected?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Custom overrides for the composed components.
|
|
82
|
+
*/
|
|
83
|
+
overrides?: NestingItemOverrides;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* NestingItem will render itself differently depending in what context it is rendered in.
|
|
87
|
+
* When not open - it will render itself as an item.
|
|
88
|
+
* When open - it will render its children.
|
|
89
|
+
*/
|
|
90
|
+
declare const NestingItem: <TCustomComponentProps extends CustomItemComponentProps>(props: NestingItemProps<TCustomComponentProps> & Omit<TCustomComponentProps, keyof CustomItemComponentProps>) => JSX.Element;
|
|
91
|
+
export default NestingItem;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CSSFn } from '@atlaskit/menu';
|
|
2
|
+
export declare const enabledCSS: {
|
|
3
|
+
"&:hover [data-custom-icon]": {
|
|
4
|
+
display: string;
|
|
5
|
+
};
|
|
6
|
+
"&:active [data-custom-icon]": {
|
|
7
|
+
display: string;
|
|
8
|
+
};
|
|
9
|
+
"&:focus [data-custom-icon]": {
|
|
10
|
+
display: string;
|
|
11
|
+
};
|
|
12
|
+
"& [data-custom-icon]": {
|
|
13
|
+
display: string;
|
|
14
|
+
};
|
|
15
|
+
"&:hover [data-right-arrow]": {
|
|
16
|
+
display: string;
|
|
17
|
+
};
|
|
18
|
+
"&:active [data-right-arrow]": {
|
|
19
|
+
display: string;
|
|
20
|
+
};
|
|
21
|
+
"&:focus [data-right-arrow]": {
|
|
22
|
+
display: string;
|
|
23
|
+
};
|
|
24
|
+
"& [data-right-arrow]": {
|
|
25
|
+
display: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const nestingItemStyle: CSSFn;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeadingItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { HeadingItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Heading item__
|
|
6
|
+
*
|
|
7
|
+
* Available for advanced use cases, for most situations providing a title to Section should be enough.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare const HeadingItem: (props: HeadingItemProps) => JSX.Element | null;
|
|
11
|
+
export default HeadingItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as HeadingItem } from './heading-item';
|
|
2
|
+
export type { HeadingItemProps } from './heading-item';
|
|
3
|
+
export { default as Section } from './section';
|
|
4
|
+
export type { SectionProps } from './section';
|
|
5
|
+
export { default as SkeletonHeadingItem } from './skeleton-heading-item';
|
|
6
|
+
export type { SkeletonHeadingItemProps } from './skeleton-heading-item';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SectionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Children of the section,
|
|
5
|
+
* should generally be item or heading components.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The text passed to heading.
|
|
10
|
+
* If a title is not provided no heading will be rendered.
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Will render a border at the top of the section.
|
|
15
|
+
*/
|
|
16
|
+
hasSeparator?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* A `testId` prop is provided for specified elements,
|
|
19
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
20
|
+
* serving as a hook for automated tests.
|
|
21
|
+
*/
|
|
22
|
+
testId?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* __Section__
|
|
26
|
+
*
|
|
27
|
+
* Used to separate items into sections. Using the title prop makes a section
|
|
28
|
+
* implicitly group the items for screen readers with no additional work required.
|
|
29
|
+
*
|
|
30
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#section)
|
|
31
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
32
|
+
*/
|
|
33
|
+
declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>>;
|
|
34
|
+
export default Section;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SkeletonHeadingItemProps } from '@atlaskit/menu';
|
|
3
|
+
export type { SkeletonHeadingItemProps } from '@atlaskit/menu';
|
|
4
|
+
/**
|
|
5
|
+
* __Skeleton heading item__
|
|
6
|
+
*
|
|
7
|
+
* A skeleton heading item for use in managing loading states.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#loading)
|
|
10
|
+
*/
|
|
11
|
+
declare const SkeletonHeadingItem: (props: SkeletonHeadingItemProps) => JSX.Element | null;
|
|
12
|
+
export default SkeletonHeadingItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SideNavigationProps {
|
|
3
|
+
/**
|
|
4
|
+
* Describes the specific role of this navigation component for users viewing the page with a screen reader.
|
|
5
|
+
* Differentiates from other navigation components on a page.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Child navigation elements.
|
|
10
|
+
* You'll want to compose children from [navigation header](/packages/navigation/side-navigation/docs/navigation-header),
|
|
11
|
+
* [navigation content](/packages/navigation/side-navigation/docs/navigation-content) or [nestable navigation content](/packages/navigation/side-navigation/docs/nestable-navigation-content),
|
|
12
|
+
* and [navigation footer](/packages/navigation/side-navigation/docs/navigation-footer).
|
|
13
|
+
*/
|
|
14
|
+
children: JSX.Element[] | JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* A `testId` prop is provided for specified elements,
|
|
17
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
18
|
+
* serving as a hook for automated tests.
|
|
19
|
+
*/
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* __Side navigation__
|
|
24
|
+
*
|
|
25
|
+
* A highly composable side navigation component that supports nested views.
|
|
26
|
+
*
|
|
27
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples)
|
|
28
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
29
|
+
* - [Usage](https://atlassian.design/components/side-navigation/usage)
|
|
30
|
+
*/
|
|
31
|
+
declare const SideNavigation: import("react").ForwardRefExoticComponent<SideNavigationProps & import("react").RefAttributes<HTMLElement>>;
|
|
32
|
+
export default SideNavigation;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as SideNavigation } from './SideNavigation';
|
|
2
|
+
export type { SideNavigationProps } from './SideNavigation';
|
|
3
|
+
export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
|
|
4
|
+
export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps, } from './Section';
|
|
5
|
+
export { default as NestingItem } from './NestingItem';
|
|
6
|
+
export type { NestingItemProps } from './NestingItem';
|
|
7
|
+
export { default as NavigationContent } from './NavigationContent';
|
|
8
|
+
export type { NavigationContentProps } from './NavigationContent';
|
|
9
|
+
export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem, } from './Item';
|
|
10
|
+
export type { CustomItemComponentProps, CustomItemProps, ButtonItemProps, GoBackItemProps, LinkItemProps, SkeletonItemProps, } from './Item';
|
|
11
|
+
export { default as Footer } from './Footer';
|
|
12
|
+
export type { FooterProps } from './Footer';
|
|
13
|
+
export { default as Header } from './Header';
|
|
14
|
+
export type { HeaderProps } from './Header';
|
|
15
|
+
export { default as NavigationHeader } from './NavigationHeader';
|
|
16
|
+
export type { NavigationHeaderProps } from './NavigationHeader';
|
|
17
|
+
export { default as NavigationFooter } from './NavigationFooter';
|
|
18
|
+
export type { NavigationFooterProps } from './NavigationFooter';
|
|
19
|
+
export { default as LoadingItems } from './LoadingItems';
|
|
20
|
+
export type { LoadingItemsProps } from './LoadingItems';
|
|
21
|
+
export { default as NestableNavigationContent } from './NestableNavigationContent';
|
|
22
|
+
export type { NestableNavigationContentProps } from './NestableNavigationContent';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
export declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: ((stack: string[]) => void) | undefined) => {
|
|
3
|
+
childIdsRef: MutableRefObject<Set<string>>;
|
|
4
|
+
};
|
|
5
|
+
export declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SideNavigation, Header, NavigationHeader, NavigationContent, Section, HeadingItem, SkeletonHeadingItem, NestableNavigationContent, NestingItem, ButtonItem, LinkItem, GoBackItem, CustomItem, SkeletonItem, Footer, NavigationFooter, LoadingItems, } from './components';
|
|
2
|
+
export type { CustomItemComponentProps, CustomItemProps, LoadingItemsProps, ButtonItemProps, FooterProps, GoBackItemProps, HeaderProps, HeadingItemProps, LinkItemProps, NavigationContentProps, NavigationFooterProps, NavigationHeaderProps, NestableNavigationContentProps, NestingItemProps, SectionProps, SideNavigationProps, SkeletonHeadingItemProps, SkeletonItemProps, } from './components';
|
|
3
|
+
export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
|
|
4
|
+
export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR, } from './common/constants';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/side-navigation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A highly composable side navigation component that supports nested views.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/ds-explorations": "^2.1.0",
|
|
36
36
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
38
|
-
"@atlaskit/menu": "^1.
|
|
38
|
+
"@atlaskit/menu": "^1.7.0",
|
|
39
39
|
"@atlaskit/motion": "^1.4.0",
|
|
40
40
|
"@atlaskit/primitives": "^0.9.0",
|
|
41
41
|
"@atlaskit/theme": "^12.5.0",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@atlaskit/visual-regression": "*",
|
|
58
58
|
"@atlaskit/webdriver-runner": "*",
|
|
59
59
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
60
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
60
61
|
"@testing-library/react": "^12.1.5",
|
|
61
62
|
"@types/jest-axe": "^3.5.0",
|
|
62
63
|
"ast-types": "^0.13.3",
|
|
@@ -85,6 +86,11 @@
|
|
|
85
86
|
"deprecation": "no-deprecated-imports"
|
|
86
87
|
}
|
|
87
88
|
},
|
|
89
|
+
"platform-feature-flags": {
|
|
90
|
+
"platform.design-system-team.menu-selected-state-change_0see9": {
|
|
91
|
+
"type": "boolean"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
88
94
|
"homepage": "https://atlassian.design/components/side-navigation/",
|
|
89
95
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
90
96
|
}
|