@atlaskit/side-navigation 2.0.0 → 2.0.1
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 +6 -0
- package/dist/cjs/components/Footer/index.js +11 -10
- package/dist/cjs/components/Header/index.js +8 -4
- package/dist/cjs/components/NavigationFooter/index.js +7 -8
- package/dist/cjs/components/NavigationHeader/index.js +9 -9
- package/dist/cjs/components/NestingItem/index.js +10 -8
- package/dist/es2019/components/Footer/index.js +7 -6
- package/dist/es2019/components/Header/index.js +6 -3
- package/dist/es2019/components/NavigationFooter/index.js +6 -6
- package/dist/es2019/components/NavigationHeader/index.js +8 -7
- package/dist/es2019/components/NestingItem/index.js +6 -5
- package/dist/esm/components/Footer/index.js +7 -6
- package/dist/esm/components/Header/index.js +6 -3
- package/dist/esm/components/NavigationFooter/index.js +6 -6
- package/dist/esm/components/NavigationHeader/index.js +8 -7
- package/dist/esm/components/NestingItem/index.js +6 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/side-navigation
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`cac6bbb702d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cac6bbb702d) - The internal composition of this component has changed. There is no expected change in behavior.
|
|
8
|
+
|
|
3
9
|
## 2.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -7,16 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
11
10
|
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
12
11
|
var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
13
|
-
var
|
|
12
|
+
var _primitives = require("@atlaskit/primitives");
|
|
14
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
14
|
var _styles = require("../../common/styles");
|
|
16
15
|
var _Header = require("../Header");
|
|
17
16
|
var _Item = require("../Item");
|
|
18
17
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
19
18
|
|
|
19
|
+
var iconContainerStyles = (0, _primitives.xcss)({
|
|
20
|
+
display: 'inline-block',
|
|
21
|
+
width: 'size.200',
|
|
22
|
+
height: 'size.200'
|
|
23
|
+
});
|
|
20
24
|
/**
|
|
21
25
|
* __Footer__
|
|
22
26
|
*
|
|
@@ -92,18 +96,15 @@ var Footer = function Footer(_ref2) {
|
|
|
92
96
|
children = _ref2.children,
|
|
93
97
|
iconBefore = _ref2.iconBefore,
|
|
94
98
|
testId = _ref2.testId;
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
96
|
-
display: "block",
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
97
100
|
padding: "space.100",
|
|
98
101
|
testId: testId
|
|
99
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
|
|
100
103
|
space: "space.100",
|
|
101
104
|
alignInline: "center"
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
height: "size.200"
|
|
106
|
-
}, iconBefore), /*#__PURE__*/_react.default.createElement(_stack.default, {
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
106
|
+
xcss: iconContainerStyles
|
|
107
|
+
}, iconBefore), /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
|
|
107
108
|
space: "space.075"
|
|
108
109
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
109
110
|
fontSize: "size.075",
|
|
@@ -10,7 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var
|
|
13
|
+
var _primitives = require("@atlaskit/primitives");
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
var _typography = require("@atlaskit/theme/typography");
|
|
16
16
|
var _styles = require("../../common/styles");
|
|
@@ -19,6 +19,11 @@ var _excluded = ["children"],
|
|
|
19
19
|
_excluded2 = ["children"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
var containerStyles = (0, _primitives.xcss)({
|
|
23
|
+
display: 'block',
|
|
24
|
+
position: 'relative'
|
|
25
|
+
});
|
|
26
|
+
|
|
22
27
|
/**
|
|
23
28
|
* __Container__
|
|
24
29
|
*
|
|
@@ -50,9 +55,8 @@ var Container = function Container(_ref) {
|
|
|
50
55
|
disabled: disabled
|
|
51
56
|
};
|
|
52
57
|
}(props);
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
54
|
-
|
|
55
|
-
display: "block"
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, (0, _extends2.default)({
|
|
59
|
+
xcss: containerStyles
|
|
56
60
|
}, safeProps), children);
|
|
57
61
|
};
|
|
58
62
|
exports.Container = Container;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
|
-
var
|
|
8
|
+
var _primitives = require("@atlaskit/primitives");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
11
|
+
var navigationFooterStyles = (0, _primitives.xcss)({
|
|
12
|
+
position: 'relative'
|
|
13
|
+
});
|
|
12
14
|
/**
|
|
13
15
|
* __Navigation footer__
|
|
14
16
|
*
|
|
@@ -19,13 +21,10 @@ var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
|
19
21
|
*/
|
|
20
22
|
var NavigationFooter = function NavigationFooter(_ref) {
|
|
21
23
|
var children = _ref.children;
|
|
22
|
-
return (0, _react.jsx)(
|
|
23
|
-
display: "block",
|
|
24
|
-
position: "relative",
|
|
24
|
+
return (0, _react.jsx)(_primitives.Box, {
|
|
25
25
|
padding: "space.100",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
26
|
+
paddingBlockEnd: "space.200",
|
|
27
|
+
xcss: navigationFooterStyles
|
|
29
28
|
}, children);
|
|
30
29
|
};
|
|
31
30
|
var _default = NavigationFooter;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
|
-
var
|
|
8
|
+
var _primitives = require("@atlaskit/primitives");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
11
|
+
var navigationFooterStyles = (0, _primitives.xcss)({
|
|
12
|
+
display: 'block',
|
|
13
|
+
padding: 'space.100',
|
|
14
|
+
paddingTop: 'space.300'
|
|
15
|
+
});
|
|
12
16
|
/**
|
|
13
17
|
* __Navigation header__
|
|
14
18
|
*
|
|
@@ -19,13 +23,9 @@ var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
|
19
23
|
*/
|
|
20
24
|
var NavigationHeader = function NavigationHeader(props) {
|
|
21
25
|
var children = props.children;
|
|
22
|
-
return (0, _react.jsx)(
|
|
23
|
-
|
|
24
|
-
"data-navheader": true
|
|
25
|
-
padding: "space.100",
|
|
26
|
-
UNSAFE_style: {
|
|
27
|
-
paddingTop: "var(--ds-space-300, 24px)"
|
|
28
|
-
}
|
|
26
|
+
return (0, _react.jsx)(_primitives.Box, {
|
|
27
|
+
xcss: navigationFooterStyles,
|
|
28
|
+
"data-navheader": true
|
|
29
29
|
}, children);
|
|
30
30
|
};
|
|
31
31
|
var _default = NavigationHeader;
|
|
@@ -13,8 +13,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
17
16
|
var _arrowRightCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/arrow-right-circle"));
|
|
17
|
+
var _primitives = require("@atlaskit/primitives");
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
19
|
var _styles = require("../../common/styles");
|
|
20
20
|
var _index = require("../index");
|
|
@@ -28,6 +28,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
var iconContainerStyles = (0, _primitives.xcss)({
|
|
32
|
+
display: 'inline'
|
|
33
|
+
});
|
|
34
|
+
|
|
31
35
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
32
36
|
|
|
33
37
|
/**
|
|
@@ -101,9 +105,7 @@ var NestingItem = function NestingItem(props) {
|
|
|
101
105
|
if (currentStackId === id) {
|
|
102
106
|
return (0, _react2.jsx)(_context.NestedContext.Provider, {
|
|
103
107
|
value: context
|
|
104
|
-
}, stack.length >= 1 && (0, _react2.jsx)(
|
|
105
|
-
as: "div",
|
|
106
|
-
display: "block",
|
|
108
|
+
}, stack.length >= 1 && (0, _react2.jsx)(_primitives.Box, {
|
|
107
109
|
paddingBlock: "space.075",
|
|
108
110
|
paddingInline: "space.100"
|
|
109
111
|
}, backButton), (0, _react2.jsx)(_index.NavigationContent, {
|
|
@@ -115,13 +117,13 @@ var NestingItem = function NestingItem(props) {
|
|
|
115
117
|
return children;
|
|
116
118
|
}
|
|
117
119
|
var componentProps = _objectSpread(_objectSpread({
|
|
118
|
-
iconAfter: (0, _react2.jsx)(_react.Fragment, null, iconAfter ? (0, _react2.jsx)(
|
|
120
|
+
iconAfter: (0, _react2.jsx)(_react.Fragment, null, iconAfter ? (0, _react2.jsx)(_primitives.Box, {
|
|
121
|
+
xcss: iconContainerStyles,
|
|
119
122
|
"data-custom-icon": true,
|
|
120
|
-
display: "inline",
|
|
121
123
|
as: "span"
|
|
122
|
-
}, iconAfter) : null, (0, _react2.jsx)(
|
|
124
|
+
}, iconAfter) : null, (0, _react2.jsx)(_primitives.Box, {
|
|
123
125
|
"data-right-arrow": true,
|
|
124
|
-
|
|
126
|
+
xcss: iconContainerStyles,
|
|
125
127
|
as: "span"
|
|
126
128
|
}, (0, _react2.jsx)(_arrowRightCircle.default, {
|
|
127
129
|
testId: testId && "".concat(testId, "--item--right-arrow"),
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
5
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
6
5
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
7
|
-
import Stack from '@atlaskit/primitives
|
|
6
|
+
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
8
7
|
import { N500 } from '@atlaskit/theme/colors';
|
|
9
8
|
import { overrideStyleFunction } from '../../common/styles';
|
|
10
9
|
import { Container } from '../Header';
|
|
11
10
|
import { CustomItem } from '../Item';
|
|
11
|
+
const iconContainerStyles = xcss({
|
|
12
|
+
display: 'inline-block',
|
|
13
|
+
width: 'size.200',
|
|
14
|
+
height: 'size.200'
|
|
15
|
+
});
|
|
12
16
|
/**
|
|
13
17
|
* __Footer__
|
|
14
18
|
*
|
|
@@ -83,16 +87,13 @@ const Footer = ({
|
|
|
83
87
|
testId
|
|
84
88
|
}) => {
|
|
85
89
|
return /*#__PURE__*/React.createElement(Box, {
|
|
86
|
-
display: "block",
|
|
87
90
|
padding: "space.100",
|
|
88
91
|
testId: testId
|
|
89
92
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
90
93
|
space: "space.100",
|
|
91
94
|
alignInline: "center"
|
|
92
95
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
93
|
-
|
|
94
|
-
width: "size.200",
|
|
95
|
-
height: "size.200"
|
|
96
|
+
xcss: iconContainerStyles
|
|
96
97
|
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
97
98
|
space: "space.075"
|
|
98
99
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import Box from '@atlaskit/
|
|
3
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
4
|
import { N500 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
6
6
|
import { overrideStyleFunction } from '../../common/styles';
|
|
7
7
|
import { CustomItem } from '../Item';
|
|
8
|
+
const containerStyles = xcss({
|
|
9
|
+
display: 'block',
|
|
10
|
+
position: 'relative'
|
|
11
|
+
});
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* __Container__
|
|
@@ -38,8 +42,7 @@ export const Container = ({
|
|
|
38
42
|
disabled
|
|
39
43
|
}))(props);
|
|
40
44
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
41
|
-
|
|
42
|
-
display: "block"
|
|
45
|
+
xcss: containerStyles
|
|
43
46
|
}, safeProps), children);
|
|
44
47
|
};
|
|
45
48
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import Box from '@atlaskit/
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
const navigationFooterStyles = xcss({
|
|
6
|
+
position: 'relative'
|
|
7
|
+
});
|
|
5
8
|
/**
|
|
6
9
|
* __Navigation footer__
|
|
7
10
|
*
|
|
@@ -14,12 +17,9 @@ const NavigationFooter = ({
|
|
|
14
17
|
children
|
|
15
18
|
}) => {
|
|
16
19
|
return jsx(Box, {
|
|
17
|
-
display: "block",
|
|
18
|
-
position: "relative",
|
|
19
20
|
padding: "space.100",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
21
|
+
paddingBlockEnd: "space.200",
|
|
22
|
+
xcss: navigationFooterStyles
|
|
23
23
|
}, children);
|
|
24
24
|
};
|
|
25
25
|
export default NavigationFooter;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import Box from '@atlaskit/
|
|
3
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
|
+
const navigationFooterStyles = xcss({
|
|
5
|
+
display: 'block',
|
|
6
|
+
padding: 'space.100',
|
|
7
|
+
paddingTop: 'space.300'
|
|
8
|
+
});
|
|
4
9
|
/**
|
|
5
10
|
* __Navigation header__
|
|
6
11
|
*
|
|
@@ -14,12 +19,8 @@ const NavigationHeader = props => {
|
|
|
14
19
|
children
|
|
15
20
|
} = props;
|
|
16
21
|
return jsx(Box, {
|
|
17
|
-
|
|
18
|
-
"data-navheader": true
|
|
19
|
-
padding: "space.100",
|
|
20
|
-
UNSAFE_style: {
|
|
21
|
-
paddingTop: "var(--ds-space-300, 24px)"
|
|
22
|
-
}
|
|
22
|
+
xcss: navigationFooterStyles,
|
|
23
|
+
"data-navheader": true
|
|
23
24
|
}, children);
|
|
24
25
|
};
|
|
25
26
|
export default NavigationHeader;
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React, { Fragment, useCallback, useMemo, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
6
5
|
import RightArrow from '@atlaskit/icon/glyph/arrow-right-circle';
|
|
6
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
7
|
import { N10 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { overrideStyleFunction } from '../../common/styles';
|
|
9
9
|
import { ButtonItem, CustomItem, NavigationContent } from '../index';
|
|
@@ -11,6 +11,9 @@ import { ROOT_ID } from '../NestableNavigationContent';
|
|
|
11
11
|
import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
|
|
12
12
|
import { useChildIdsEffect } from '../utils/hooks';
|
|
13
13
|
import { nestingItemStyle } from './styles';
|
|
14
|
+
const iconContainerStyles = xcss({
|
|
15
|
+
display: 'inline'
|
|
16
|
+
});
|
|
14
17
|
|
|
15
18
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
16
19
|
|
|
@@ -82,8 +85,6 @@ const NestingItem = props => {
|
|
|
82
85
|
return jsx(NestedContext.Provider, {
|
|
83
86
|
value: context
|
|
84
87
|
}, stack.length >= 1 && jsx(Box, {
|
|
85
|
-
as: "div",
|
|
86
|
-
display: "block",
|
|
87
88
|
paddingBlock: "space.075",
|
|
88
89
|
paddingInline: "space.100"
|
|
89
90
|
}, backButton), jsx(NavigationContent, {
|
|
@@ -96,12 +97,12 @@ const NestingItem = props => {
|
|
|
96
97
|
}
|
|
97
98
|
const componentProps = {
|
|
98
99
|
iconAfter: jsx(Fragment, null, iconAfter ? jsx(Box, {
|
|
100
|
+
xcss: iconContainerStyles,
|
|
99
101
|
"data-custom-icon": true,
|
|
100
|
-
display: "inline",
|
|
101
102
|
as: "span"
|
|
102
103
|
}, iconAfter) : null, jsx(Box, {
|
|
103
104
|
"data-right-arrow": true,
|
|
104
|
-
|
|
105
|
+
xcss: iconContainerStyles,
|
|
105
106
|
as: "span"
|
|
106
107
|
}, jsx(RightArrow, {
|
|
107
108
|
testId: testId && `${testId}--item--right-arrow`,
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
5
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
6
5
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
7
|
-
import Stack from '@atlaskit/primitives
|
|
6
|
+
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
8
7
|
import { N500 } from '@atlaskit/theme/colors';
|
|
9
8
|
import { overrideStyleFunction } from '../../common/styles';
|
|
10
9
|
import { Container } from '../Header';
|
|
11
10
|
import { CustomItem } from '../Item';
|
|
11
|
+
var iconContainerStyles = xcss({
|
|
12
|
+
display: 'inline-block',
|
|
13
|
+
width: 'size.200',
|
|
14
|
+
height: 'size.200'
|
|
15
|
+
});
|
|
12
16
|
/**
|
|
13
17
|
* __Footer__
|
|
14
18
|
*
|
|
@@ -85,16 +89,13 @@ var Footer = function Footer(_ref2) {
|
|
|
85
89
|
iconBefore = _ref2.iconBefore,
|
|
86
90
|
testId = _ref2.testId;
|
|
87
91
|
return /*#__PURE__*/React.createElement(Box, {
|
|
88
|
-
display: "block",
|
|
89
92
|
padding: "space.100",
|
|
90
93
|
testId: testId
|
|
91
94
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
92
95
|
space: "space.100",
|
|
93
96
|
alignInline: "center"
|
|
94
97
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
95
|
-
|
|
96
|
-
width: "size.200",
|
|
97
|
-
height: "size.200"
|
|
98
|
+
xcss: iconContainerStyles
|
|
98
99
|
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
99
100
|
space: "space.075"
|
|
100
101
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -4,11 +4,15 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
var _excluded = ["children"],
|
|
5
5
|
_excluded2 = ["children"];
|
|
6
6
|
import React, { forwardRef } from 'react';
|
|
7
|
-
import Box from '@atlaskit/
|
|
7
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
8
|
import { N500 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
10
10
|
import { overrideStyleFunction } from '../../common/styles';
|
|
11
11
|
import { CustomItem } from '../Item';
|
|
12
|
+
var containerStyles = xcss({
|
|
13
|
+
display: 'block',
|
|
14
|
+
position: 'relative'
|
|
15
|
+
});
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* __Container__
|
|
@@ -42,8 +46,7 @@ export var Container = function Container(_ref) {
|
|
|
42
46
|
};
|
|
43
47
|
}(props);
|
|
44
48
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
45
|
-
|
|
46
|
-
display: "block"
|
|
49
|
+
xcss: containerStyles
|
|
47
50
|
}, safeProps), children);
|
|
48
51
|
};
|
|
49
52
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import Box from '@atlaskit/
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
var navigationFooterStyles = xcss({
|
|
6
|
+
position: 'relative'
|
|
7
|
+
});
|
|
5
8
|
/**
|
|
6
9
|
* __Navigation footer__
|
|
7
10
|
*
|
|
@@ -13,12 +16,9 @@ import Box from '@atlaskit/ds-explorations/box';
|
|
|
13
16
|
var NavigationFooter = function NavigationFooter(_ref) {
|
|
14
17
|
var children = _ref.children;
|
|
15
18
|
return jsx(Box, {
|
|
16
|
-
display: "block",
|
|
17
|
-
position: "relative",
|
|
18
19
|
padding: "space.100",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
20
|
+
paddingBlockEnd: "space.200",
|
|
21
|
+
xcss: navigationFooterStyles
|
|
22
22
|
}, children);
|
|
23
23
|
};
|
|
24
24
|
export default NavigationFooter;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import Box from '@atlaskit/
|
|
3
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
|
+
var navigationFooterStyles = xcss({
|
|
5
|
+
display: 'block',
|
|
6
|
+
padding: 'space.100',
|
|
7
|
+
paddingTop: 'space.300'
|
|
8
|
+
});
|
|
4
9
|
/**
|
|
5
10
|
* __Navigation header__
|
|
6
11
|
*
|
|
@@ -12,12 +17,8 @@ import Box from '@atlaskit/ds-explorations/box';
|
|
|
12
17
|
var NavigationHeader = function NavigationHeader(props) {
|
|
13
18
|
var children = props.children;
|
|
14
19
|
return jsx(Box, {
|
|
15
|
-
|
|
16
|
-
"data-navheader": true
|
|
17
|
-
padding: "space.100",
|
|
18
|
-
UNSAFE_style: {
|
|
19
|
-
paddingTop: "var(--ds-space-300, 24px)"
|
|
20
|
-
}
|
|
20
|
+
xcss: navigationFooterStyles,
|
|
21
|
+
"data-navheader": true
|
|
21
22
|
}, children);
|
|
22
23
|
};
|
|
23
24
|
export default NavigationHeader;
|
|
@@ -9,8 +9,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import React, { Fragment, useCallback, useMemo, useState } from 'react';
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
13
12
|
import RightArrow from '@atlaskit/icon/glyph/arrow-right-circle';
|
|
13
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
14
14
|
import { N10 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { overrideStyleFunction } from '../../common/styles';
|
|
16
16
|
import { ButtonItem, CustomItem, NavigationContent } from '../index';
|
|
@@ -18,6 +18,9 @@ import { ROOT_ID } from '../NestableNavigationContent';
|
|
|
18
18
|
import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
|
|
19
19
|
import { useChildIdsEffect } from '../utils/hooks';
|
|
20
20
|
import { nestingItemStyle } from './styles';
|
|
21
|
+
var iconContainerStyles = xcss({
|
|
22
|
+
display: 'inline'
|
|
23
|
+
});
|
|
21
24
|
|
|
22
25
|
// Doesn't extend from ButtonItemProps because it blows ERT up.
|
|
23
26
|
|
|
@@ -93,8 +96,6 @@ var NestingItem = function NestingItem(props) {
|
|
|
93
96
|
return jsx(NestedContext.Provider, {
|
|
94
97
|
value: context
|
|
95
98
|
}, stack.length >= 1 && jsx(Box, {
|
|
96
|
-
as: "div",
|
|
97
|
-
display: "block",
|
|
98
99
|
paddingBlock: "space.075",
|
|
99
100
|
paddingInline: "space.100"
|
|
100
101
|
}, backButton), jsx(NavigationContent, {
|
|
@@ -107,12 +108,12 @@ var NestingItem = function NestingItem(props) {
|
|
|
107
108
|
}
|
|
108
109
|
var componentProps = _objectSpread(_objectSpread({
|
|
109
110
|
iconAfter: jsx(Fragment, null, iconAfter ? jsx(Box, {
|
|
111
|
+
xcss: iconContainerStyles,
|
|
110
112
|
"data-custom-icon": true,
|
|
111
|
-
display: "inline",
|
|
112
113
|
as: "span"
|
|
113
114
|
}, iconAfter) : null, jsx(Box, {
|
|
114
115
|
"data-right-arrow": true,
|
|
115
|
-
|
|
116
|
+
xcss: iconContainerStyles,
|
|
116
117
|
as: "span"
|
|
117
118
|
}, jsx(RightArrow, {
|
|
118
119
|
testId: testId && "".concat(testId, "--item--right-arrow"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/side-navigation",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A highly composable side navigation component that supports nested views.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/motion": "^1.4.0",
|
|
40
40
|
"@atlaskit/primitives": "^1.2.0",
|
|
41
41
|
"@atlaskit/theme": "^12.5.0",
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/tokens": "^1.15.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|