@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,4 +1,3 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
"use strict";
|
|
3
2
|
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -7,17 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
6
|
value: true
|
|
8
7
|
});
|
|
9
8
|
exports.default = void 0;
|
|
10
|
-
require("./index.compiled.css");
|
|
11
|
-
var _runtime = require("@compiled/react/runtime");
|
|
12
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
18
16
|
var _arrowRightArrowRightCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/arrow-right--arrow-right-circle"));
|
|
19
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
-
var
|
|
18
|
+
var _primitives = require("@atlaskit/primitives");
|
|
21
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
20
|
var _styles = require("../../common/styles");
|
|
23
21
|
var _index = require("../index");
|
|
@@ -26,13 +24,18 @@ var _context = require("../NestableNavigationContent/context");
|
|
|
26
24
|
var _hooks = require("../utils/hooks");
|
|
27
25
|
var _styles2 = require("./styles");
|
|
28
26
|
var _excluded = ["children", "iconAfter", "title", "onClick", "cssFn", "isSelected", "id", "component", "testId"];
|
|
27
|
+
/**
|
|
28
|
+
* @jsxRuntime classic
|
|
29
|
+
* @jsx jsx
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
31
34
|
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; }
|
|
32
35
|
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) { (0, _defineProperty2.default)(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; }
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
+
var iconContainerStyles = (0, _primitives.xcss)({
|
|
37
|
+
display: 'inline'
|
|
38
|
+
});
|
|
36
39
|
|
|
37
40
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
38
41
|
|
|
@@ -140,12 +143,12 @@ var NestingItem = function NestingItem(props) {
|
|
|
140
143
|
onClick && onClick(e);
|
|
141
144
|
}, [isInteracted, onClick, onNest, id]);
|
|
142
145
|
if (currentStackId === id) {
|
|
143
|
-
return
|
|
146
|
+
return (0, _react2.jsx)(_context.NestedContext.Provider, {
|
|
144
147
|
value: context
|
|
145
|
-
}, stack.length >= 1 &&
|
|
148
|
+
}, stack.length >= 1 && (0, _react2.jsx)(_primitives.Box, {
|
|
146
149
|
paddingBlock: "space.075",
|
|
147
150
|
paddingInline: "space.100"
|
|
148
|
-
}, backButton),
|
|
151
|
+
}, backButton), (0, _react2.jsx)(_index.NavigationContent, {
|
|
149
152
|
testId: testId,
|
|
150
153
|
showTopScrollIndicator: forceShowTopScrollIndicator || stack.length >= 1
|
|
151
154
|
}, children));
|
|
@@ -154,15 +157,15 @@ var NestingItem = function NestingItem(props) {
|
|
|
154
157
|
return children;
|
|
155
158
|
}
|
|
156
159
|
var componentProps = _objectSpread(_objectSpread({
|
|
157
|
-
iconAfter:
|
|
158
|
-
xcss:
|
|
160
|
+
iconAfter: (0, _react2.jsx)(_react.Fragment, null, iconAfter ? (0, _react2.jsx)(_primitives.Box, {
|
|
161
|
+
xcss: iconContainerStyles,
|
|
159
162
|
"data-custom-icon": true,
|
|
160
163
|
as: "span"
|
|
161
|
-
}, iconAfter) : null,
|
|
164
|
+
}, iconAfter) : null, (0, _react2.jsx)(_primitives.Box, {
|
|
162
165
|
"data-right-arrow": true,
|
|
163
|
-
xcss:
|
|
166
|
+
xcss: iconContainerStyles,
|
|
164
167
|
as: "span"
|
|
165
|
-
},
|
|
168
|
+
}, (0, _react2.jsx)(_arrowRightArrowRightCircle.default, {
|
|
166
169
|
testId: testId && "".concat(testId, "--item--right-arrow"),
|
|
167
170
|
color: "currentColor",
|
|
168
171
|
LEGACY_secondaryColor: "var(--ds-surface, ".concat(_colors.N10, ")"),
|
|
@@ -176,14 +179,14 @@ var NestingItem = function NestingItem(props) {
|
|
|
176
179
|
cssFn: mergedStyles
|
|
177
180
|
});
|
|
178
181
|
if (component) {
|
|
179
|
-
return
|
|
182
|
+
return (0, _react2.jsx)(_index.CustomItem, (0, _extends2.default)({
|
|
180
183
|
ref: isForwardRefCheck(component) ? parentItemRef : null
|
|
181
184
|
}, componentProps, {
|
|
182
185
|
//@ts-expect-error TODO Fix legit TypeScript 3.9.6 improved inference error
|
|
183
186
|
component: component
|
|
184
187
|
}));
|
|
185
188
|
}
|
|
186
|
-
return
|
|
189
|
+
return (0, _react2.jsx)(_index.ButtonItem, (0, _extends2.default)({
|
|
187
190
|
ref: activeParentRef
|
|
188
191
|
}, componentProps));
|
|
189
192
|
};
|
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
"use strict";
|
|
3
2
|
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
4
|
Object.defineProperty(exports, "__esModule", {
|
|
7
5
|
value: true
|
|
8
6
|
});
|
|
9
7
|
exports.default = void 0;
|
|
10
|
-
require("./index.compiled.css");
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var React = _react;
|
|
13
|
-
var _runtime = require("@compiled/react/runtime");
|
|
14
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
15
11
|
var _menu = require("@atlaskit/menu");
|
|
16
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @jsxRuntime classic
|
|
15
|
+
* @jsx jsx
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
|
+
|
|
19
20
|
var sidebarMinWidth = '240px';
|
|
20
|
-
var sideNavStyles =
|
|
21
|
+
var sideNavStyles = (0, _react2.css)({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
width: '100%',
|
|
24
|
+
minWidth: sidebarMinWidth,
|
|
25
|
+
height: '100%',
|
|
26
|
+
position: 'relative',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
backgroundColor: "var(--ds-surface, ".concat(_colors.N10, ")"),
|
|
29
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N500, ")"),
|
|
30
|
+
overflow: 'hidden'
|
|
31
|
+
});
|
|
21
32
|
|
|
22
33
|
/**
|
|
23
34
|
* __Side navigation__
|
|
@@ -36,22 +47,17 @@ var SideNavigation = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
36
47
|
isServer = _props$isServer === void 0 ? false : _props$isServer,
|
|
37
48
|
_props$isSSRPlacehold = props.isSSRPlaceholderEnabled,
|
|
38
49
|
isSSRPlaceholderEnabled = _props$isSSRPlacehold === void 0 ? false : _props$isSSRPlacehold;
|
|
39
|
-
return
|
|
50
|
+
return (0, _react2.jsx)("nav", (0, _extends2.default)({
|
|
40
51
|
ref: ref,
|
|
41
52
|
"data-testid": testId,
|
|
42
53
|
"aria-label": label,
|
|
54
|
+
css: sideNavStyles,
|
|
43
55
|
"data-vc": "side-navigation".concat(isServer ? '-ssr' : '')
|
|
44
56
|
}, isServer && isSSRPlaceholderEnabled && {
|
|
45
57
|
'data-ssr-placeholder': 'side-navigation-placeholder'
|
|
46
58
|
}, !isServer && isSSRPlaceholderEnabled && {
|
|
47
59
|
'data-ssr-placeholder-replace': 'side-navigation-placeholder'
|
|
48
|
-
}, {
|
|
49
|
-
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _1e0c1txw _1bsb1osq _1ul9p3fh _4t3i1osq _kqswh2mm _2lx21bp4 _bfhkxkvu _syaz1425"]),
|
|
50
|
-
style: {
|
|
51
|
-
"--_4p0s90": (0, _runtime.ix)("var(--ds-surface, ".concat(_colors.N10, ")")),
|
|
52
|
-
"--_13a5t4u": (0, _runtime.ix)("var(--ds-text-subtle, ".concat(_colors.N500, ")"))
|
|
53
|
-
}
|
|
54
|
-
}), /*#__PURE__*/React.createElement(_menu.SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
60
|
+
}), (0, _react2.jsx)(_menu.SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
55
61
|
value: "notch"
|
|
56
62
|
}, children));
|
|
57
63
|
});
|
|
@@ -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
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const iconContainerStyles = xcss({
|
|
11
|
+
display: 'inline-block',
|
|
12
|
+
width: '1.5rem',
|
|
13
|
+
height: '1.5rem'
|
|
14
|
+
});
|
|
17
15
|
/**
|
|
18
16
|
* __Footer__
|
|
19
17
|
*
|
|
@@ -94,7 +92,7 @@ const Footer = ({
|
|
|
94
92
|
space: "space.100",
|
|
95
93
|
alignInline: "center"
|
|
96
94
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
97
|
-
xcss:
|
|
95
|
+
xcss: iconContainerStyles
|
|
98
96
|
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
99
97
|
space: "space.075"
|
|
100
98
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
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';
|
|
3
10
|
import { N500 } from '@atlaskit/theme/colors';
|
|
4
11
|
import { overrideStyleFunction } from '../../common/styles';
|
|
5
12
|
import { CustomItem } from '../Item';
|
|
13
|
+
const containerStyles = css({
|
|
14
|
+
display: 'block',
|
|
15
|
+
position: 'relative'
|
|
16
|
+
});
|
|
6
17
|
|
|
7
18
|
/**
|
|
8
19
|
* __Container__
|
|
@@ -34,16 +45,10 @@ export const Container = ({
|
|
|
34
45
|
tabIndex,
|
|
35
46
|
disabled
|
|
36
47
|
}))(props);
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"data-testid": testId,
|
|
42
|
-
style: {
|
|
43
|
-
position: 'relative'
|
|
44
|
-
}
|
|
45
|
-
}, safeProps), children)
|
|
46
|
-
);
|
|
48
|
+
return jsx("div", _extends({
|
|
49
|
+
"data-testid": testId,
|
|
50
|
+
css: containerStyles
|
|
51
|
+
}, safeProps), children);
|
|
47
52
|
};
|
|
48
53
|
/**
|
|
49
54
|
* __Header__
|
|
@@ -68,7 +73,7 @@ const Header = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
68
73
|
color: `var(--ds-text, ${N500})`
|
|
69
74
|
}
|
|
70
75
|
}), props.cssFn);
|
|
71
|
-
return
|
|
76
|
+
return jsx(CustomItem, _extends({}, props, {
|
|
72
77
|
ref: ref,
|
|
73
78
|
component: props.component || Container
|
|
74
79
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
@@ -82,7 +87,7 @@ const Header = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
82
87
|
render: (_, {
|
|
83
88
|
children,
|
|
84
89
|
...props
|
|
85
|
-
}) =>
|
|
90
|
+
}) => jsx("h2", props, children)
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
}));
|
|
@@ -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
|
-
const baseMotionStyles =
|
|
9
|
-
|
|
10
|
+
const 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
|
+
const enteringStyles = css({
|
|
21
|
+
position: 'static',
|
|
22
|
+
zIndex: 2
|
|
23
|
+
});
|
|
10
24
|
|
|
11
25
|
/**
|
|
12
26
|
* __Loading items__
|
|
@@ -25,12 +39,12 @@ const LoadingItems = ({
|
|
|
25
39
|
if (!shouldRender) {
|
|
26
40
|
return children;
|
|
27
41
|
}
|
|
28
|
-
return
|
|
42
|
+
return jsx(ExitingPersistence, null, jsx(FadeIn, {
|
|
29
43
|
key: `loading-section-${isLoading}`,
|
|
30
44
|
duration: mediumDurationMs
|
|
31
|
-
}, (motion, state) =>
|
|
45
|
+
}, (motion, state) => jsx("span", _extends({}, motion, {
|
|
32
46
|
"data-testid": testId && `${testId}--${state}`,
|
|
33
|
-
|
|
47
|
+
css: [baseMotionStyles, state === 'entering' && enteringStyles]
|
|
34
48
|
}), isLoading ? fallback : children)));
|
|
35
49
|
};
|
|
36
50
|
export default LoadingItems;
|
|
@@ -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
|
-
const 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
|
-
const 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
|
*
|
|
@@ -36,15 +31,24 @@ const NavigationContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
31
|
return children;
|
|
37
32
|
}
|
|
38
33
|
const typedRef = ref;
|
|
39
|
-
return
|
|
40
|
-
ref: typedRef
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
return jsx("div", {
|
|
35
|
+
ref: typedRef
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
37
|
+
,
|
|
38
|
+
css: outerContainerCSS({
|
|
39
|
+
showTopScrollIndicator,
|
|
40
|
+
scrollbarWidth: scrollbar.width
|
|
41
|
+
}),
|
|
42
|
+
"data-testid": testId
|
|
43
|
+
}, jsx("div", {
|
|
44
44
|
ref: scrollbar.ref,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
css: innerContainerCSS({
|
|
46
|
+
showTopScrollIndicator
|
|
47
|
+
})
|
|
48
|
+
}, jsx("div", {
|
|
49
|
+
css: containerCSS({
|
|
50
|
+
showTopScrollIndicator
|
|
51
|
+
})
|
|
48
52
|
}, children)));
|
|
49
53
|
});
|
|
50
54
|
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
|
+
const navigationFooterStyles = xcss({
|
|
4
|
+
position: 'relative'
|
|
5
|
+
});
|
|
6
|
+
|
|
9
7
|
/**
|
|
10
8
|
* __Navigation footer__
|
|
11
9
|
*
|
|
@@ -20,7 +18,7 @@ const NavigationFooter = ({
|
|
|
20
18
|
return /*#__PURE__*/React.createElement(Box, {
|
|
21
19
|
padding: "space.100",
|
|
22
20
|
paddingBlockEnd: "space.200",
|
|
23
|
-
xcss:
|
|
21
|
+
xcss: navigationFooterStyles
|
|
24
22
|
}, children);
|
|
25
23
|
};
|
|
26
24
|
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
|
+
const 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
|
*
|
|
@@ -18,8 +25,8 @@ const NavigationHeader = props => {
|
|
|
18
25
|
const {
|
|
19
26
|
children
|
|
20
27
|
} = props;
|
|
21
|
-
return
|
|
22
|
-
xcss:
|
|
28
|
+
return jsx(Box, {
|
|
29
|
+
xcss: navigationFooterStyles,
|
|
23
30
|
"data-navheader": true
|
|
24
31
|
}, children);
|
|
25
32
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
5
6
|
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } 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';
|
|
6
10
|
import { ExitingPersistence } from '@atlaskit/motion';
|
|
7
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
12
|
import { GoBackItem as GoBackButton } from '../Item';
|
|
@@ -13,8 +17,18 @@ import { NestingMotion } from './nesting-motion';
|
|
|
13
17
|
// Named so ERT doesn't pick up the override name as a type.
|
|
14
18
|
|
|
15
19
|
export const ROOT_ID = 'ATLASKIT_NESTED_ROOT';
|
|
16
|
-
const nestableNavigationContentStyles =
|
|
17
|
-
|
|
20
|
+
const nestableNavigationContentStyles = css({
|
|
21
|
+
height: '100%',
|
|
22
|
+
position: 'relative',
|
|
23
|
+
outline: 'none'
|
|
24
|
+
});
|
|
25
|
+
const nestingRootStyles = css({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
width: '100%',
|
|
28
|
+
height: '100%',
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
flexDirection: 'column'
|
|
31
|
+
});
|
|
18
32
|
|
|
19
33
|
/**
|
|
20
34
|
* __Nestable navigation content__
|
|
@@ -46,7 +60,7 @@ const NestableNavigationContent = props => {
|
|
|
46
60
|
const [activeParentId, setActiveParentId] = useState('');
|
|
47
61
|
const [focusGoBackButton, setFocusGoBackButton] = useState(false);
|
|
48
62
|
const shouldFocus = isDefaultFocusControl && fg('platform-side-navigation-keyboard-focus');
|
|
49
|
-
const renderGoBackItem = overrides && overrides.GoBackItem && overrides.GoBackItem.render ? overrides.GoBackItem.render : props =>
|
|
63
|
+
const renderGoBackItem = overrides && overrides.GoBackItem && overrides.GoBackItem.render ? overrides.GoBackItem.render : props => jsx(GoBackButton, props, "Go back");
|
|
50
64
|
const {
|
|
51
65
|
childIdsRef
|
|
52
66
|
} = useChildIds(currentStackId, committedStack, onUnknownNest);
|
|
@@ -135,13 +149,13 @@ const NestableNavigationContent = props => {
|
|
|
135
149
|
containerRef.current && containerRef.current.focus();
|
|
136
150
|
}
|
|
137
151
|
};
|
|
138
|
-
return
|
|
152
|
+
return jsx(Fragment, null, jsx("div", {
|
|
139
153
|
"data-testid": testId,
|
|
154
|
+
css: nestableNavigationContentStyles,
|
|
140
155
|
ref: containerRef,
|
|
141
156
|
tabIndex: -1,
|
|
142
|
-
onClick: manageFocus
|
|
143
|
-
|
|
144
|
-
}, /*#__PURE__*/React.createElement(ExitingPersistence, null, /*#__PURE__*/React.createElement(NestingMotion
|
|
157
|
+
onClick: manageFocus
|
|
158
|
+
}, jsx(ExitingPersistence, null, jsx(NestingMotion
|
|
145
159
|
// Key is needed to have a unique react instance per stack name.
|
|
146
160
|
// This enables us to easily animate it in & out with exiting persistence.
|
|
147
161
|
, {
|
|
@@ -149,13 +163,13 @@ const NestableNavigationContent = props => {
|
|
|
149
163
|
enterFrom: transition === 'nesting' ? 'right' : 'left',
|
|
150
164
|
exitTo: transition === 'nesting' ? 'left' : 'right',
|
|
151
165
|
testId: testId && `${testId}-anim`
|
|
152
|
-
}, motion =>
|
|
153
|
-
|
|
154
|
-
}),
|
|
166
|
+
}, motion => jsx("div", _extends({
|
|
167
|
+
css: nestingRootStyles
|
|
168
|
+
}, motion), jsx(NestedContext.Provider, {
|
|
155
169
|
// This provider is inside the NestingMotion to ensure it keeps a stale
|
|
156
170
|
// reference to the previous value.
|
|
157
171
|
value: context
|
|
158
|
-
},
|
|
172
|
+
}, jsx(NestingItem, {
|
|
159
173
|
title: "",
|
|
160
174
|
id: ROOT_ID
|
|
161
175
|
}, children)))))));
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
2
8
|
import { easeOut, SlideIn } from '@atlaskit/motion';
|
|
3
9
|
/**
|
|
4
10
|
* @internal
|
|
@@ -10,7 +16,7 @@ export const NestingMotion = props => {
|
|
|
10
16
|
exitTo,
|
|
11
17
|
testId
|
|
12
18
|
} = props;
|
|
13
|
-
return
|
|
19
|
+
return jsx(SlideIn, {
|
|
14
20
|
exitTo: exitTo,
|
|
15
21
|
enterFrom: enterFrom,
|
|
16
22
|
animationTimingFunction: _ => easeOut
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
5
6
|
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
import { jsx } from '@emotion/react';
|
|
6
10
|
import ArrowRightIcon from '@atlaskit/icon/core/migration/arrow-right--arrow-right-circle';
|
|
7
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { Box } from '@atlaskit/primitives
|
|
12
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
9
13
|
import { N10 } from '@atlaskit/theme/colors';
|
|
10
14
|
import { overrideStyleFunction } from '../../common/styles';
|
|
11
15
|
import { ButtonItem, CustomItem, NavigationContent } from '../index';
|
|
@@ -13,9 +17,9 @@ import { ROOT_ID } from '../NestableNavigationContent';
|
|
|
13
17
|
import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
|
|
14
18
|
import { useChildIdsEffect } from '../utils/hooks';
|
|
15
19
|
import { nestingItemStyle } from './styles';
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
};
|
|
20
|
+
const iconContainerStyles = xcss({
|
|
21
|
+
display: 'inline'
|
|
22
|
+
});
|
|
19
23
|
|
|
20
24
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
21
25
|
|
|
@@ -119,12 +123,12 @@ const NestingItem = props => {
|
|
|
119
123
|
onClick && onClick(e);
|
|
120
124
|
}, [isInteracted, onClick, onNest, id]);
|
|
121
125
|
if (currentStackId === id) {
|
|
122
|
-
return
|
|
126
|
+
return jsx(NestedContext.Provider, {
|
|
123
127
|
value: context
|
|
124
|
-
}, stack.length >= 1 &&
|
|
128
|
+
}, stack.length >= 1 && jsx(Box, {
|
|
125
129
|
paddingBlock: "space.075",
|
|
126
130
|
paddingInline: "space.100"
|
|
127
|
-
}, backButton),
|
|
131
|
+
}, backButton), jsx(NavigationContent, {
|
|
128
132
|
testId: testId,
|
|
129
133
|
showTopScrollIndicator: forceShowTopScrollIndicator || stack.length >= 1
|
|
130
134
|
}, children));
|
|
@@ -133,15 +137,15 @@ const NestingItem = props => {
|
|
|
133
137
|
return children;
|
|
134
138
|
}
|
|
135
139
|
const componentProps = {
|
|
136
|
-
iconAfter:
|
|
137
|
-
xcss:
|
|
140
|
+
iconAfter: jsx(Fragment, null, iconAfter ? jsx(Box, {
|
|
141
|
+
xcss: iconContainerStyles,
|
|
138
142
|
"data-custom-icon": true,
|
|
139
143
|
as: "span"
|
|
140
|
-
}, iconAfter) : null,
|
|
144
|
+
}, iconAfter) : null, jsx(Box, {
|
|
141
145
|
"data-right-arrow": true,
|
|
142
|
-
xcss:
|
|
146
|
+
xcss: iconContainerStyles,
|
|
143
147
|
as: "span"
|
|
144
|
-
},
|
|
148
|
+
}, jsx(ArrowRightIcon, {
|
|
145
149
|
testId: testId && `${testId}--item--right-arrow`,
|
|
146
150
|
color: "currentColor",
|
|
147
151
|
LEGACY_secondaryColor: `var(--ds-surface, ${N10})`,
|
|
@@ -155,14 +159,14 @@ const NestingItem = props => {
|
|
|
155
159
|
cssFn: mergedStyles
|
|
156
160
|
};
|
|
157
161
|
if (component) {
|
|
158
|
-
return
|
|
162
|
+
return jsx(CustomItem, _extends({
|
|
159
163
|
ref: isForwardRefCheck(component) ? parentItemRef : null
|
|
160
164
|
}, componentProps, {
|
|
161
165
|
//@ts-expect-error TODO Fix legit TypeScript 3.9.6 improved inference error
|
|
162
166
|
component: component
|
|
163
167
|
}));
|
|
164
168
|
}
|
|
165
|
-
return
|
|
169
|
+
return jsx(ButtonItem, _extends({
|
|
166
170
|
ref: activeParentRef
|
|
167
171
|
}, componentProps));
|
|
168
172
|
};
|