@atlaskit/side-navigation 4.0.0 → 4.2.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 +22 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +0 -3
- package/afm-post-office/tsconfig.json +0 -3
- package/dist/cjs/components/Footer/index.js +18 -21
- package/dist/cjs/components/Header/index.js +18 -16
- package/dist/cjs/components/LoadingItems/index.js +24 -9
- package/dist/cjs/components/NavigationContent/index.js +26 -27
- package/dist/cjs/components/NavigationFooter/index.js +9 -13
- package/dist/cjs/components/NavigationHeader/index.js +18 -13
- package/dist/cjs/components/NestableNavigationContent/index.js +29 -14
- package/dist/cjs/components/NestableNavigationContent/nesting-motion.js +6 -3
- package/dist/cjs/components/NestingItem/index.js +20 -17
- package/dist/cjs/components/SideNavigation/index.js +23 -17
- package/dist/es2019/components/Footer/index.js +8 -10
- package/dist/es2019/components/Header/index.js +18 -13
- package/dist/es2019/components/LoadingItems/index.js +23 -9
- package/dist/es2019/components/NavigationContent/index.js +26 -22
- package/dist/es2019/components/NavigationFooter/index.js +7 -9
- package/dist/es2019/components/NavigationHeader/index.js +17 -10
- package/dist/es2019/components/NestableNavigationContent/index.js +28 -14
- package/dist/es2019/components/NestableNavigationContent/nesting-motion.js +8 -2
- package/dist/es2019/components/NestingItem/index.js +21 -17
- package/dist/es2019/components/SideNavigation/index.js +21 -9
- package/dist/esm/components/Footer/index.js +8 -10
- package/dist/esm/components/Header/index.js +18 -13
- package/dist/esm/components/LoadingItems/index.js +23 -9
- package/dist/esm/components/NavigationContent/index.js +26 -25
- package/dist/esm/components/NavigationFooter/index.js +7 -9
- package/dist/esm/components/NavigationHeader/index.js +17 -10
- package/dist/esm/components/NestableNavigationContent/index.js +28 -14
- package/dist/esm/components/NestableNavigationContent/nesting-motion.js +8 -2
- package/dist/esm/components/NestingItem/index.js +21 -17
- package/dist/esm/components/SideNavigation/index.js +21 -13
- package/dist/types/components/Header/index.d.ts +4 -3
- package/dist/types/components/LoadingItems/index.d.ts +1 -5
- package/dist/types/components/NavigationContent/index.d.ts +2 -2
- package/dist/types/components/NavigationFooter/index.d.ts +0 -4
- package/dist/types/components/NavigationHeader/index.d.ts +6 -1
- package/dist/types/components/NestableNavigationContent/index.d.ts +2 -1
- package/dist/types/components/NestableNavigationContent/nesting-motion.d.ts +7 -2
- package/dist/types-ts4.5/components/Header/index.d.ts +4 -3
- package/dist/types-ts4.5/components/LoadingItems/index.d.ts +1 -5
- package/dist/types-ts4.5/components/NavigationContent/index.d.ts +2 -2
- package/dist/types-ts4.5/components/NavigationFooter/index.d.ts +0 -4
- package/dist/types-ts4.5/components/NavigationHeader/index.d.ts +6 -1
- package/dist/types-ts4.5/components/NestableNavigationContent/index.d.ts +2 -1
- package/dist/types-ts4.5/components/NestableNavigationContent/nesting-motion.d.ts +7 -2
- package/package.json +10 -11
- package/dist/cjs/components/Footer/index.compiled.css +0 -3
- package/dist/cjs/components/LoadingItems/index.compiled.css +0 -7
- package/dist/cjs/components/NavigationContent/index.compiled.css +0 -46
- package/dist/cjs/components/NavigationFooter/index.compiled.css +0 -1
- package/dist/cjs/components/NavigationHeader/index.compiled.css +0 -3
- package/dist/cjs/components/NestableNavigationContent/index.compiled.css +0 -9
- package/dist/cjs/components/NestingItem/index.compiled.css +0 -1
- package/dist/cjs/components/SideNavigation/index.compiled.css +0 -10
- package/dist/es2019/components/Footer/index.compiled.css +0 -3
- package/dist/es2019/components/LoadingItems/index.compiled.css +0 -7
- package/dist/es2019/components/NavigationContent/index.compiled.css +0 -46
- package/dist/es2019/components/NavigationFooter/index.compiled.css +0 -1
- package/dist/es2019/components/NavigationHeader/index.compiled.css +0 -3
- package/dist/es2019/components/NestableNavigationContent/index.compiled.css +0 -9
- package/dist/es2019/components/NestingItem/index.compiled.css +0 -1
- package/dist/es2019/components/SideNavigation/index.compiled.css +0 -10
- package/dist/esm/components/Footer/index.compiled.css +0 -3
- package/dist/esm/components/LoadingItems/index.compiled.css +0 -7
- package/dist/esm/components/NavigationContent/index.compiled.css +0 -46
- package/dist/esm/components/NavigationFooter/index.compiled.css +0 -1
- package/dist/esm/components/NavigationHeader/index.compiled.css +0 -3
- package/dist/esm/components/NestableNavigationContent/index.compiled.css +0 -9
- package/dist/esm/components/NestingItem/index.compiled.css +0 -1
- package/dist/esm/components/SideNavigation/index.compiled.css +0 -10
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
7
10
|
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
8
11
|
import { N10, N500 } from '@atlaskit/theme/colors';
|
|
9
12
|
const sidebarMinWidth = '240px';
|
|
10
|
-
const sideNavStyles =
|
|
13
|
+
const sideNavStyles = css({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
width: '100%',
|
|
16
|
+
minWidth: sidebarMinWidth,
|
|
17
|
+
height: '100%',
|
|
18
|
+
position: 'relative',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
backgroundColor: `var(--ds-surface, ${N10})`,
|
|
21
|
+
color: `var(--ds-text-subtle, ${N500})`,
|
|
22
|
+
overflow: 'hidden'
|
|
23
|
+
});
|
|
11
24
|
|
|
12
25
|
/**
|
|
13
26
|
* __Side navigation__
|
|
@@ -26,18 +39,17 @@ const SideNavigation = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26
39
|
isServer = false,
|
|
27
40
|
isSSRPlaceholderEnabled = false
|
|
28
41
|
} = props;
|
|
29
|
-
return
|
|
42
|
+
return jsx("nav", _extends({
|
|
30
43
|
ref: ref,
|
|
31
44
|
"data-testid": testId,
|
|
32
45
|
"aria-label": label,
|
|
46
|
+
css: sideNavStyles,
|
|
33
47
|
"data-vc": `side-navigation${isServer ? '-ssr' : ''}`
|
|
34
48
|
}, isServer && isSSRPlaceholderEnabled && {
|
|
35
49
|
'data-ssr-placeholder': 'side-navigation-placeholder'
|
|
36
50
|
}, !isServer && isSSRPlaceholderEnabled && {
|
|
37
51
|
'data-ssr-placeholder-replace': 'side-navigation-placeholder'
|
|
38
|
-
}, {
|
|
39
|
-
className: ax(["_1reo15vq _18m915vq _1e0c1txw _1bsb1osq _1ul9p3fh _4t3i1osq _kqswh2mm _2lx21bp4 _bfhkw70a _syazjjyb"])
|
|
40
|
-
}), /*#__PURE__*/React.createElement(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
52
|
+
}), jsx(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
41
53
|
value: "notch"
|
|
42
54
|
}, children));
|
|
43
55
|
});
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import "./index.compiled.css";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
6
2
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
7
|
-
|
|
3
|
+
import React from 'react';
|
|
8
4
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
9
|
-
import { Box, Stack, Text } from '@atlaskit/primitives
|
|
5
|
+
import { Box, Stack, Text, xcss } from '@atlaskit/primitives';
|
|
10
6
|
import { N500 } from '@atlaskit/theme/colors';
|
|
11
7
|
import { overrideStyleFunction } from '../../common/styles';
|
|
12
8
|
import { Container } from '../Header';
|
|
13
9
|
import { CustomItem } from '../Item';
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var iconContainerStyles = xcss({
|
|
11
|
+
display: 'inline-block',
|
|
12
|
+
width: '1.5rem',
|
|
13
|
+
height: '1.5rem'
|
|
14
|
+
});
|
|
17
15
|
/**
|
|
18
16
|
* __Footer__
|
|
19
17
|
*
|
|
@@ -96,7 +94,7 @@ var Footer = function Footer(_ref2) {
|
|
|
96
94
|
space: "space.100",
|
|
97
95
|
alignInline: "center"
|
|
98
96
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
99
|
-
xcss:
|
|
97
|
+
xcss: iconContainerStyles
|
|
100
98
|
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
101
99
|
space: "space.075"
|
|
102
100
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -3,10 +3,21 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "data-testid"],
|
|
5
5
|
_excluded2 = ["children"];
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @jsxRuntime classic
|
|
8
|
+
* @jsx jsx
|
|
9
|
+
*/
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
7
14
|
import { N500 } from '@atlaskit/theme/colors';
|
|
8
15
|
import { overrideStyleFunction } from '../../common/styles';
|
|
9
16
|
import { CustomItem } from '../Item';
|
|
17
|
+
var containerStyles = css({
|
|
18
|
+
display: 'block',
|
|
19
|
+
position: 'relative'
|
|
20
|
+
});
|
|
10
21
|
|
|
11
22
|
/**
|
|
12
23
|
* __Container__
|
|
@@ -38,16 +49,10 @@ export var Container = function Container(_ref) {
|
|
|
38
49
|
disabled: disabled
|
|
39
50
|
};
|
|
40
51
|
}(props);
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"data-testid": testId,
|
|
46
|
-
style: {
|
|
47
|
-
position: 'relative'
|
|
48
|
-
}
|
|
49
|
-
}, safeProps), children)
|
|
50
|
-
);
|
|
52
|
+
return jsx("div", _extends({
|
|
53
|
+
"data-testid": testId,
|
|
54
|
+
css: containerStyles
|
|
55
|
+
}, safeProps), children);
|
|
51
56
|
};
|
|
52
57
|
/**
|
|
53
58
|
* __Header__
|
|
@@ -70,7 +75,7 @@ var Header = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
70
75
|
color: "var(--ds-text, ".concat(N500, ")")
|
|
71
76
|
});
|
|
72
77
|
}, props.cssFn);
|
|
73
|
-
return
|
|
78
|
+
return jsx(CustomItem, _extends({}, props, {
|
|
74
79
|
ref: ref,
|
|
75
80
|
component: props.component || Container
|
|
76
81
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
@@ -84,7 +89,7 @@ var Header = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
89
|
render: function render(_, _ref4) {
|
|
85
90
|
var children = _ref4.children,
|
|
86
91
|
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
87
|
-
return
|
|
92
|
+
return jsx("h2", props, children);
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import { ExitingPersistence, FadeIn, mediumDurationMs } from '@atlaskit/motion';
|
|
7
9
|
import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
|
|
8
|
-
var baseMotionStyles =
|
|
9
|
-
|
|
10
|
+
var baseMotionStyles = css({
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
zIndex: 1,
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/no-physical-properties
|
|
14
|
+
top: 0,
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/no-physical-properties
|
|
16
|
+
right: 0,
|
|
17
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/design-system/no-physical-properties
|
|
18
|
+
left: 0
|
|
19
|
+
});
|
|
20
|
+
var enteringStyles = css({
|
|
21
|
+
position: 'static',
|
|
22
|
+
zIndex: 2
|
|
23
|
+
});
|
|
10
24
|
|
|
11
25
|
/**
|
|
12
26
|
* __Loading items__
|
|
@@ -23,13 +37,13 @@ var LoadingItems = function LoadingItems(_ref) {
|
|
|
23
37
|
if (!shouldRender) {
|
|
24
38
|
return children;
|
|
25
39
|
}
|
|
26
|
-
return
|
|
40
|
+
return jsx(ExitingPersistence, null, jsx(FadeIn, {
|
|
27
41
|
key: "loading-section-".concat(isLoading),
|
|
28
42
|
duration: mediumDurationMs
|
|
29
43
|
}, function (motion, state) {
|
|
30
|
-
return
|
|
44
|
+
return jsx("span", _extends({}, motion, {
|
|
31
45
|
"data-testid": testId && "".concat(testId, "--").concat(state),
|
|
32
|
-
|
|
46
|
+
css: [baseMotionStyles, state === 'entering' && enteringStyles]
|
|
33
47
|
}), isLoading ? fallback : children);
|
|
34
48
|
}));
|
|
35
49
|
};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx } from '@emotion/react';
|
|
5
9
|
import useScrollbarWidth from '@atlaskit/ds-lib/use-scrollbar-width';
|
|
6
10
|
import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
|
|
7
|
-
|
|
8
|
-
var innerContainerCSS = {
|
|
9
|
-
basic: "_1reo1wug _18m91wug _1e0c1txw _vchhusvi _1bsb1osq _kqswh2mm _2lx21bp4 _14mjgqwt _1ywu1ule _1qdgyh40 _18poh2mm _1bqqcs5v _tua5idpf _1hfk1q2g _aetrb3bt _3mxo1wug",
|
|
10
|
-
topScrollIndicator: "_rfx3gqwt _cfu11ule _kfgtyh40 _1cs8stnw _1g0vcs5v _1rus1q2g _1kt9b3bt _1enwidpf _z5wtidpf"
|
|
11
|
-
};
|
|
12
|
-
var containerCSS = {
|
|
13
|
-
basic: "_kqswh2mm _12l2u2gc _ahbqu2gc _1pfhidpf _1p3h12x7 _1l6bpxbi _auo4rdoj _hp2110yn",
|
|
14
|
-
marginBlockStart: "_1pfhv77o"
|
|
15
|
-
};
|
|
16
|
-
|
|
11
|
+
import { containerCSS, innerContainerCSS, outerContainerCSS } from './styles';
|
|
17
12
|
/**
|
|
18
13
|
* __Navigation content__
|
|
19
14
|
*
|
|
@@ -33,18 +28,24 @@ var NavigationContent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
28
|
return children;
|
|
34
29
|
}
|
|
35
30
|
var typedRef = ref;
|
|
36
|
-
return
|
|
37
|
-
ref: typedRef
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
return jsx("div", {
|
|
32
|
+
ref: typedRef
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
34
|
+
,
|
|
35
|
+
css: outerContainerCSS({
|
|
36
|
+
showTopScrollIndicator: showTopScrollIndicator,
|
|
37
|
+
scrollbarWidth: scrollbar.width
|
|
38
|
+
}),
|
|
39
|
+
"data-testid": testId
|
|
40
|
+
}, jsx("div", {
|
|
44
41
|
ref: scrollbar.ref,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
css: innerContainerCSS({
|
|
43
|
+
showTopScrollIndicator: showTopScrollIndicator
|
|
44
|
+
})
|
|
45
|
+
}, jsx("div", {
|
|
46
|
+
css: containerCSS({
|
|
47
|
+
showTopScrollIndicator: showTopScrollIndicator
|
|
48
|
+
})
|
|
48
49
|
}, children)));
|
|
49
50
|
});
|
|
50
51
|
export default NavigationContent;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
navigationFooter: "_kqswh2mm"
|
|
8
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
|
+
var navigationFooterStyles = xcss({
|
|
4
|
+
position: 'relative'
|
|
5
|
+
});
|
|
6
|
+
|
|
9
7
|
/**
|
|
10
8
|
* __Navigation footer__
|
|
11
9
|
*
|
|
@@ -19,7 +17,7 @@ var NavigationFooter = function NavigationFooter(_ref) {
|
|
|
19
17
|
return /*#__PURE__*/React.createElement(Box, {
|
|
20
18
|
padding: "space.100",
|
|
21
19
|
paddingBlockEnd: "space.200",
|
|
22
|
-
xcss:
|
|
20
|
+
xcss: navigationFooterStyles
|
|
23
21
|
}, children);
|
|
24
22
|
};
|
|
25
23
|
export default NavigationFooter;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
|
+
var navigationFooterStyles = xcss({
|
|
9
|
+
display: 'block',
|
|
10
|
+
paddingTop: 'space.100',
|
|
11
|
+
paddingRight: 'space.100',
|
|
12
|
+
paddingBottom: 'space.100',
|
|
13
|
+
paddingLeft: 'space.100',
|
|
14
|
+
paddingBlockStart: 'space.300'
|
|
15
|
+
});
|
|
9
16
|
/**
|
|
10
17
|
* __Navigation header__
|
|
11
18
|
*
|
|
@@ -16,8 +23,8 @@ var styles = {
|
|
|
16
23
|
*/
|
|
17
24
|
var NavigationHeader = function NavigationHeader(props) {
|
|
18
25
|
var children = props.children;
|
|
19
|
-
return
|
|
20
|
-
xcss:
|
|
26
|
+
return jsx(Box, {
|
|
27
|
+
xcss: navigationFooterStyles,
|
|
21
28
|
"data-navheader": true
|
|
22
29
|
}, children);
|
|
23
30
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
6
7
|
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
7
11
|
import { ExitingPersistence } from '@atlaskit/motion';
|
|
8
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
13
|
import { GoBackItem as GoBackButton } from '../Item';
|
|
@@ -14,8 +18,18 @@ import { NestingMotion } from './nesting-motion';
|
|
|
14
18
|
// Named so ERT doesn't pick up the override name as a type.
|
|
15
19
|
|
|
16
20
|
export var ROOT_ID = 'ATLASKIT_NESTED_ROOT';
|
|
17
|
-
var nestableNavigationContentStyles =
|
|
18
|
-
|
|
21
|
+
var nestableNavigationContentStyles = css({
|
|
22
|
+
height: '100%',
|
|
23
|
+
position: 'relative',
|
|
24
|
+
outline: 'none'
|
|
25
|
+
});
|
|
26
|
+
var nestingRootStyles = css({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
width: '100%',
|
|
29
|
+
height: '100%',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
flexDirection: 'column'
|
|
32
|
+
});
|
|
19
33
|
|
|
20
34
|
/**
|
|
21
35
|
* __Nestable navigation content__
|
|
@@ -59,7 +73,7 @@ var NestableNavigationContent = function NestableNavigationContent(props) {
|
|
|
59
73
|
setFocusGoBackButton = _useState8[1];
|
|
60
74
|
var shouldFocus = isDefaultFocusControl && fg('platform-side-navigation-keyboard-focus');
|
|
61
75
|
var renderGoBackItem = overrides && overrides.GoBackItem && overrides.GoBackItem.render ? overrides.GoBackItem.render : function (props) {
|
|
62
|
-
return
|
|
76
|
+
return jsx(GoBackButton, props, "Go back");
|
|
63
77
|
};
|
|
64
78
|
var _useChildIds = useChildIds(currentStackId, committedStack, onUnknownNest),
|
|
65
79
|
childIdsRef = _useChildIds.childIdsRef;
|
|
@@ -150,13 +164,13 @@ var NestableNavigationContent = function NestableNavigationContent(props) {
|
|
|
150
164
|
containerRef.current && containerRef.current.focus();
|
|
151
165
|
}
|
|
152
166
|
};
|
|
153
|
-
return
|
|
167
|
+
return jsx(Fragment, null, jsx("div", {
|
|
154
168
|
"data-testid": testId,
|
|
169
|
+
css: nestableNavigationContentStyles,
|
|
155
170
|
ref: containerRef,
|
|
156
171
|
tabIndex: -1,
|
|
157
|
-
onClick: manageFocus
|
|
158
|
-
|
|
159
|
-
}, /*#__PURE__*/React.createElement(ExitingPersistence, null, /*#__PURE__*/React.createElement(NestingMotion
|
|
172
|
+
onClick: manageFocus
|
|
173
|
+
}, jsx(ExitingPersistence, null, jsx(NestingMotion
|
|
160
174
|
// Key is needed to have a unique react instance per stack name.
|
|
161
175
|
// This enables us to easily animate it in & out with exiting persistence.
|
|
162
176
|
, {
|
|
@@ -165,13 +179,13 @@ var NestableNavigationContent = function NestableNavigationContent(props) {
|
|
|
165
179
|
exitTo: transition === 'nesting' ? 'left' : 'right',
|
|
166
180
|
testId: testId && "".concat(testId, "-anim")
|
|
167
181
|
}, function (motion) {
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
}),
|
|
182
|
+
return jsx("div", _extends({
|
|
183
|
+
css: nestingRootStyles
|
|
184
|
+
}, motion), jsx(NestedContext.Provider, {
|
|
171
185
|
// This provider is inside the NestingMotion to ensure it keeps a stale
|
|
172
186
|
// reference to the previous value.
|
|
173
187
|
value: context
|
|
174
|
-
},
|
|
188
|
+
}, jsx(NestingItem, {
|
|
175
189
|
title: "",
|
|
176
190
|
id: ROOT_ID
|
|
177
191
|
}, children)));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
+
import { jsx } from '@emotion/react';
|
|
5
11
|
import { easeOut, SlideIn } from '@atlaskit/motion';
|
|
6
12
|
/**
|
|
7
13
|
* @internal
|
|
@@ -11,7 +17,7 @@ export var NestingMotion = function NestingMotion(props) {
|
|
|
11
17
|
enterFrom = props.enterFrom,
|
|
12
18
|
exitTo = props.exitTo,
|
|
13
19
|
testId = props.testId;
|
|
14
|
-
return
|
|
20
|
+
return jsx(SlideIn, {
|
|
15
21
|
exitTo: exitTo,
|
|
16
22
|
enterFrom: enterFrom,
|
|
17
23
|
animationTimingFunction: function animationTimingFunction(_) {
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
7
6
|
var _excluded = ["children", "iconAfter", "title", "onClick", "cssFn", "isSelected", "id", "component", "testId"];
|
|
8
|
-
import "./index.compiled.css";
|
|
9
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
10
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
/**
|
|
10
|
+
* @jsxRuntime classic
|
|
11
|
+
* @jsx jsx
|
|
12
|
+
*/
|
|
12
13
|
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
|
+
import { jsx } from '@emotion/react';
|
|
13
17
|
import ArrowRightIcon from '@atlaskit/icon/core/migration/arrow-right--arrow-right-circle';
|
|
14
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { Box } from '@atlaskit/primitives
|
|
19
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
16
20
|
import { N10 } from '@atlaskit/theme/colors';
|
|
17
21
|
import { overrideStyleFunction } from '../../common/styles';
|
|
18
22
|
import { ButtonItem, CustomItem, NavigationContent } from '../index';
|
|
@@ -20,9 +24,9 @@ import { ROOT_ID } from '../NestableNavigationContent';
|
|
|
20
24
|
import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
|
|
21
25
|
import { useChildIdsEffect } from '../utils/hooks';
|
|
22
26
|
import { nestingItemStyle } from './styles';
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
};
|
|
27
|
+
var iconContainerStyles = xcss({
|
|
28
|
+
display: 'inline'
|
|
29
|
+
});
|
|
26
30
|
|
|
27
31
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
28
32
|
|
|
@@ -130,12 +134,12 @@ var NestingItem = function NestingItem(props) {
|
|
|
130
134
|
onClick && onClick(e);
|
|
131
135
|
}, [isInteracted, onClick, onNest, id]);
|
|
132
136
|
if (currentStackId === id) {
|
|
133
|
-
return
|
|
137
|
+
return jsx(NestedContext.Provider, {
|
|
134
138
|
value: context
|
|
135
|
-
}, stack.length >= 1 &&
|
|
139
|
+
}, stack.length >= 1 && jsx(Box, {
|
|
136
140
|
paddingBlock: "space.075",
|
|
137
141
|
paddingInline: "space.100"
|
|
138
|
-
}, backButton),
|
|
142
|
+
}, backButton), jsx(NavigationContent, {
|
|
139
143
|
testId: testId,
|
|
140
144
|
showTopScrollIndicator: forceShowTopScrollIndicator || stack.length >= 1
|
|
141
145
|
}, children));
|
|
@@ -144,15 +148,15 @@ var NestingItem = function NestingItem(props) {
|
|
|
144
148
|
return children;
|
|
145
149
|
}
|
|
146
150
|
var componentProps = _objectSpread(_objectSpread({
|
|
147
|
-
iconAfter:
|
|
148
|
-
xcss:
|
|
151
|
+
iconAfter: jsx(Fragment, null, iconAfter ? jsx(Box, {
|
|
152
|
+
xcss: iconContainerStyles,
|
|
149
153
|
"data-custom-icon": true,
|
|
150
154
|
as: "span"
|
|
151
|
-
}, iconAfter) : null,
|
|
155
|
+
}, iconAfter) : null, jsx(Box, {
|
|
152
156
|
"data-right-arrow": true,
|
|
153
|
-
xcss:
|
|
157
|
+
xcss: iconContainerStyles,
|
|
154
158
|
as: "span"
|
|
155
|
-
},
|
|
159
|
+
}, jsx(ArrowRightIcon, {
|
|
156
160
|
testId: testId && "".concat(testId, "--item--right-arrow"),
|
|
157
161
|
color: "currentColor",
|
|
158
162
|
LEGACY_secondaryColor: "var(--ds-surface, ".concat(N10, ")"),
|
|
@@ -166,14 +170,14 @@ var NestingItem = function NestingItem(props) {
|
|
|
166
170
|
cssFn: mergedStyles
|
|
167
171
|
});
|
|
168
172
|
if (component) {
|
|
169
|
-
return
|
|
173
|
+
return jsx(CustomItem, _extends({
|
|
170
174
|
ref: isForwardRefCheck(component) ? parentItemRef : null
|
|
171
175
|
}, componentProps, {
|
|
172
176
|
//@ts-expect-error TODO Fix legit TypeScript 3.9.6 improved inference error
|
|
173
177
|
component: component
|
|
174
178
|
}));
|
|
175
179
|
}
|
|
176
|
-
return
|
|
180
|
+
return jsx(ButtonItem, _extends({
|
|
177
181
|
ref: activeParentRef
|
|
178
182
|
}, componentProps));
|
|
179
183
|
};
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
7
10
|
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
8
11
|
import { N10, N500 } from '@atlaskit/theme/colors';
|
|
9
12
|
var sidebarMinWidth = '240px';
|
|
10
|
-
var sideNavStyles =
|
|
13
|
+
var sideNavStyles = css({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
width: '100%',
|
|
16
|
+
minWidth: sidebarMinWidth,
|
|
17
|
+
height: '100%',
|
|
18
|
+
position: 'relative',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
backgroundColor: "var(--ds-surface, ".concat(N10, ")"),
|
|
21
|
+
color: "var(--ds-text-subtle, ".concat(N500, ")"),
|
|
22
|
+
overflow: 'hidden'
|
|
23
|
+
});
|
|
11
24
|
|
|
12
25
|
/**
|
|
13
26
|
* __Side navigation__
|
|
@@ -26,22 +39,17 @@ var SideNavigation = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
26
39
|
isServer = _props$isServer === void 0 ? false : _props$isServer,
|
|
27
40
|
_props$isSSRPlacehold = props.isSSRPlaceholderEnabled,
|
|
28
41
|
isSSRPlaceholderEnabled = _props$isSSRPlacehold === void 0 ? false : _props$isSSRPlacehold;
|
|
29
|
-
return
|
|
42
|
+
return jsx("nav", _extends({
|
|
30
43
|
ref: ref,
|
|
31
44
|
"data-testid": testId,
|
|
32
45
|
"aria-label": label,
|
|
46
|
+
css: sideNavStyles,
|
|
33
47
|
"data-vc": "side-navigation".concat(isServer ? '-ssr' : '')
|
|
34
48
|
}, isServer && isSSRPlaceholderEnabled && {
|
|
35
49
|
'data-ssr-placeholder': 'side-navigation-placeholder'
|
|
36
50
|
}, !isServer && isSSRPlaceholderEnabled && {
|
|
37
51
|
'data-ssr-placeholder-replace': 'side-navigation-placeholder'
|
|
38
|
-
}, {
|
|
39
|
-
className: ax(["_1reo15vq _18m915vq _1e0c1txw _1bsb1osq _1ul9p3fh _4t3i1osq _kqswh2mm _2lx21bp4 _bfhkxkvu _syaz1425"]),
|
|
40
|
-
style: {
|
|
41
|
-
"--_4p0s90": ix("var(--ds-surface, ".concat(N10, ")")),
|
|
42
|
-
"--_13a5t4u": ix("var(--ds-text-subtle, ".concat(N500, ")"))
|
|
43
|
-
}
|
|
44
|
-
}), /*#__PURE__*/React.createElement(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
52
|
+
}), jsx(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
45
53
|
value: "notch"
|
|
46
54
|
}, children));
|
|
47
55
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
import { type CSSFn, type CustomItemComponentProps } from '@atlaskit/menu';
|
|
3
4
|
/**
|
|
4
5
|
* __Container__
|
|
5
6
|
*
|
|
6
7
|
* A container for Header and Footer that safely handles props to the child component
|
|
7
8
|
*/
|
|
8
|
-
export declare const Container: ({ children, "data-testid": testId, ...props }: CustomItemComponentProps) => JSX.Element;
|
|
9
|
+
export declare const Container: ({ children, "data-testid": testId, ...props }: CustomItemComponentProps) => jsx.JSX.Element;
|
|
9
10
|
export type HeaderProps = {
|
|
10
11
|
/**
|
|
11
12
|
* A function that can be used to override the styles of the component.
|
|
@@ -51,5 +52,5 @@ export type HeaderProps = {
|
|
|
51
52
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
52
53
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
53
54
|
*/
|
|
54
|
-
declare const Header:
|
|
55
|
+
declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLElement>>;
|
|
55
56
|
export default Header;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { type HTMLAttributes } from 'react';
|
|
6
6
|
export interface NavigationContentProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
@@ -24,5 +24,5 @@ export interface NavigationContentProps {
|
|
|
24
24
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#content)
|
|
25
25
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
26
26
|
*/
|
|
27
|
-
declare const NavigationContent:
|
|
27
|
+
declare const NavigationContent: import("react").ForwardRefExoticComponent<NavigationContentProps & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
28
28
|
export default NavigationContent;
|