@atlaskit/side-navigation 1.5.3 → 1.6.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 +21 -0
- package/constellation/index/props.mdx +1 -1
- package/dist/cjs/common/styles.js +3 -10
- package/dist/cjs/components/Footer/index.js +83 -2
- package/dist/cjs/components/SideNavigation/index.js +7 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/styles.js +3 -10
- package/dist/es2019/components/Footer/index.js +83 -2
- package/dist/es2019/components/SideNavigation/index.js +7 -9
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/styles.js +3 -10
- package/dist/esm/components/Footer/index.js +82 -2
- package/dist/esm/components/SideNavigation/index.js +7 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Footer/index.d.ts +21 -4
- package/dist/types/components/Header/index.d.ts +2 -3
- package/docs/ert/footer.tsx +16 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/side-navigation
|
|
2
2
|
|
|
3
|
+
## 1.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3ca97be0c06`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3ca97be0c06) - Internal change only. Replace usages of Inline/Stack with stable version from `@atlaskit/primitives`.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 1.6.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`62c9d42799c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62c9d42799c) - [ux] The `Footer` component will now warn a user if they are relying on a deprecated API. The `cssFn`, `onClick` and `component` are all considered deprecated APIs for `Footer`.
|
|
15
|
+
|
|
16
|
+
Additionally, the space between icons and content has been shifted form `16px` to `12px`. This matches `@atlaskit/menu`.
|
|
17
|
+
|
|
18
|
+
These APIs will be removed from Footer in a future major release. To suppress the warning you can choose to use the `useDeprecatedApi={false}` prop which opts into the new API.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 1.5.3
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SideNavigationProps from '!!extract-react-types-loader!../../src/components/SideNavigation'
|
|
2
2
|
import HeaderProps from '!!extract-react-types-loader!../../src/components/Header'
|
|
3
|
-
import FooterProps from '!!extract-react-types-loader!../../
|
|
3
|
+
import FooterProps from '!!extract-react-types-loader!../../docs/ert/footer'
|
|
4
4
|
import NavigationContentProps from '!!extract-react-types-loader!../../src/components/NavigationContent'
|
|
5
5
|
import NestableNavigationContentProps from '!!extract-react-types-loader!../../src/components/NestableNavigationContent'
|
|
6
6
|
import SectionProps from '!!extract-react-types-loader!../../src/components/Section'
|
|
@@ -59,23 +59,16 @@ var baseSideNavItemStyle = function baseSideNavItemStyle(_ref) {
|
|
|
59
59
|
return _objectSpread(_objectSpread(_objectSpread({
|
|
60
60
|
// This padding is set to ensure that the center of the left icon
|
|
61
61
|
// is approximately center aligned with the horizontal app switcher.
|
|
62
|
-
|
|
62
|
+
paddingBlock: "var(--ds-space-100, 8px)",
|
|
63
|
+
paddingInline: "var(--ds-space-100, 10px)",
|
|
63
64
|
borderRadius: borderRadius,
|
|
64
65
|
// -- TODO: DELETE THESE COLOR OVERRIDES WHEN CLEANING UP FALLBACK THEMING --
|
|
65
66
|
// Menu and side navigation are now color aligned so they do not need this!
|
|
66
67
|
// See: https://product-fabric.atlassian.net/browse/DSP-1684
|
|
67
68
|
backgroundColor: "var(--ds-background-neutral-subtle, transparent)"
|
|
68
69
|
}, !isDisabled && !isSelected && defaultStyles), !isDisabled && isSelected && selectedStyles), {}, (0, _defineProperty2.default)({}, '& [data-item-elem-before]', {
|
|
69
|
-
// TODO: Can this be moved into menu?
|
|
70
|
-
// center align icons with app-switcher regardless of size
|
|
71
|
-
display: 'flex',
|
|
72
70
|
height: "var(--ds-space-300, 24px)",
|
|
73
|
-
width: "var(--ds-space-300, 24px)"
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
justifyContent: 'center',
|
|
76
|
-
// this margin could be removed if the respective item had a more
|
|
77
|
-
// compositional API so an Inline could be used to separate elements instead
|
|
78
|
-
marginRight: "var(--ds-space-200, 16px)"
|
|
71
|
+
width: "var(--ds-space-300, 24px)"
|
|
79
72
|
}));
|
|
80
73
|
};
|
|
81
74
|
exports.baseSideNavItemStyle = baseSideNavItemStyle;
|
|
@@ -7,17 +7,23 @@ 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
|
+
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
12
|
+
var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
13
|
+
var _stack = _interopRequireDefault(require("@atlaskit/primitives/stack"));
|
|
10
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
15
|
var _styles = require("../../common/styles");
|
|
12
16
|
var _Header = require("../Header");
|
|
13
17
|
var _Item = require("../Item");
|
|
18
|
+
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
19
|
+
|
|
14
20
|
/**
|
|
15
21
|
* __Footer__
|
|
16
22
|
*
|
|
17
23
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
18
24
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
19
25
|
*/
|
|
20
|
-
var
|
|
26
|
+
var OldFooter = function OldFooter(props) {
|
|
21
27
|
var cssFn = (0, _styles.overrideStyleFunction)(function () {
|
|
22
28
|
return {
|
|
23
29
|
userSelect: 'auto',
|
|
@@ -74,5 +80,80 @@ var Footer = function Footer(props) {
|
|
|
74
80
|
cssFn: cssFn
|
|
75
81
|
}));
|
|
76
82
|
};
|
|
77
|
-
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* __Footer__
|
|
86
|
+
*
|
|
87
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
88
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
89
|
+
*/
|
|
90
|
+
var Footer = function Footer(_ref2) {
|
|
91
|
+
var description = _ref2.description,
|
|
92
|
+
children = _ref2.children,
|
|
93
|
+
iconBefore = _ref2.iconBefore,
|
|
94
|
+
testId = _ref2.testId;
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
96
|
+
display: "block",
|
|
97
|
+
padding: "space.100",
|
|
98
|
+
testId: testId
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_stack.default, {
|
|
100
|
+
space: "100",
|
|
101
|
+
alignInline: "center"
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
103
|
+
display: "inlineBlock",
|
|
104
|
+
width: "size.200",
|
|
105
|
+
height: "size.200"
|
|
106
|
+
}, iconBefore), /*#__PURE__*/_react.default.createElement(_stack.default, {
|
|
107
|
+
space: "075"
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
109
|
+
fontSize: "size.075",
|
|
110
|
+
textAlign: "center",
|
|
111
|
+
lineHeight: "lineHeight.100"
|
|
112
|
+
}, children), description && /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
113
|
+
lineHeight: "lineHeight.100",
|
|
114
|
+
as: "div",
|
|
115
|
+
fontSize: "size.075",
|
|
116
|
+
textAlign: "center",
|
|
117
|
+
color: "subtlest"
|
|
118
|
+
}, description))));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* __Footer__
|
|
123
|
+
*
|
|
124
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
125
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
126
|
+
*/
|
|
127
|
+
var FooterFacade = function FooterFacade(_ref3) {
|
|
128
|
+
var _ref3$useDeprecatedAp = _ref3.useDeprecatedApi,
|
|
129
|
+
useDeprecatedApi = _ref3$useDeprecatedAp === void 0 ? true : _ref3$useDeprecatedAp,
|
|
130
|
+
description = _ref3.description,
|
|
131
|
+
iconBefore = _ref3.iconBefore,
|
|
132
|
+
testId = _ref3.testId,
|
|
133
|
+
children = _ref3.children,
|
|
134
|
+
component = _ref3.component,
|
|
135
|
+
cssFn = _ref3.cssFn,
|
|
136
|
+
onClick = _ref3.onClick;
|
|
137
|
+
if (!useDeprecatedApi) {
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement(Footer, {
|
|
139
|
+
iconBefore: iconBefore,
|
|
140
|
+
description: description,
|
|
141
|
+
testId: testId
|
|
142
|
+
}, children);
|
|
143
|
+
}
|
|
144
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'CI') {
|
|
145
|
+
(0, _warnOnce.default)('The `@atlaskit/side-navigation` Footer has simplified its API, removing support for the `component`, `cssFn` and `onClick` props.\n\nThese props will stop working in a future major release. Reach out to #help-design-system on slack for help.');
|
|
146
|
+
}
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement(OldFooter, {
|
|
148
|
+
onClick: onClick,
|
|
149
|
+
component: component
|
|
150
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
151
|
+
,
|
|
152
|
+
cssFn: cssFn,
|
|
153
|
+
iconBefore: iconBefore,
|
|
154
|
+
description: description,
|
|
155
|
+
testId: testId
|
|
156
|
+
}, children);
|
|
157
|
+
};
|
|
158
|
+
var _default = FooterFacade;
|
|
78
159
|
exports.default = _default;
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _react2 = require("@emotion/react");
|
|
9
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
10
|
+
/* eslint-disable @repo/internal/react/use-primitives */
|
|
10
11
|
/** @jsx jsx */
|
|
11
12
|
|
|
12
13
|
var sidebarMinWidth = '240px';
|
|
@@ -35,15 +36,12 @@ var SideNavigation = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
35
36
|
var children = props.children,
|
|
36
37
|
testId = props.testId,
|
|
37
38
|
label = props.label;
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
css: sideNavStyles
|
|
45
|
-
}, children)
|
|
46
|
-
);
|
|
39
|
+
return (0, _react2.jsx)("nav", {
|
|
40
|
+
ref: ref,
|
|
41
|
+
"data-testid": testId,
|
|
42
|
+
"aria-label": label,
|
|
43
|
+
css: sideNavStyles
|
|
44
|
+
}, children);
|
|
47
45
|
});
|
|
48
46
|
var _default = SideNavigation;
|
|
49
47
|
exports.default = _default;
|
package/dist/cjs/version.json
CHANGED
|
@@ -46,7 +46,8 @@ export const baseSideNavItemStyle = ({
|
|
|
46
46
|
return {
|
|
47
47
|
// This padding is set to ensure that the center of the left icon
|
|
48
48
|
// is approximately center aligned with the horizontal app switcher.
|
|
49
|
-
|
|
49
|
+
paddingBlock: "var(--ds-space-100, 8px)",
|
|
50
|
+
paddingInline: "var(--ds-space-100, 10px)",
|
|
50
51
|
borderRadius,
|
|
51
52
|
// -- TODO: DELETE THESE COLOR OVERRIDES WHEN CLEANING UP FALLBACK THEMING --
|
|
52
53
|
// Menu and side navigation are now color aligned so they do not need this!
|
|
@@ -57,16 +58,8 @@ export const baseSideNavItemStyle = ({
|
|
|
57
58
|
// -- END TODO --------------------------------------------------------------
|
|
58
59
|
|
|
59
60
|
['& [data-item-elem-before]']: {
|
|
60
|
-
// TODO: Can this be moved into menu?
|
|
61
|
-
// center align icons with app-switcher regardless of size
|
|
62
|
-
display: 'flex',
|
|
63
61
|
height: "var(--ds-space-300, 24px)",
|
|
64
|
-
width: "var(--ds-space-300, 24px)"
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
justifyContent: 'center',
|
|
67
|
-
// this margin could be removed if the respective item had a more
|
|
68
|
-
// compositional API so an Inline could be used to separate elements instead
|
|
69
|
-
marginRight: "var(--ds-space-200, 16px)"
|
|
62
|
+
width: "var(--ds-space-300, 24px)"
|
|
70
63
|
}
|
|
71
64
|
};
|
|
72
65
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
5
|
+
import Text from '@atlaskit/ds-explorations/text';
|
|
6
|
+
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
7
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
3
8
|
import { N500 } from '@atlaskit/theme/colors';
|
|
4
9
|
import { overrideStyleFunction } from '../../common/styles';
|
|
5
10
|
import { Container } from '../Header';
|
|
@@ -10,7 +15,7 @@ import { CustomItem } from '../Item';
|
|
|
10
15
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
11
16
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
12
17
|
*/
|
|
13
|
-
const
|
|
18
|
+
const OldFooter = props => {
|
|
14
19
|
const cssFn = overrideStyleFunction(() => ({
|
|
15
20
|
userSelect: 'auto',
|
|
16
21
|
display: 'block',
|
|
@@ -64,4 +69,80 @@ const Footer = props => {
|
|
|
64
69
|
cssFn: cssFn
|
|
65
70
|
}));
|
|
66
71
|
};
|
|
67
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* __Footer__
|
|
75
|
+
*
|
|
76
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
77
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
78
|
+
*/
|
|
79
|
+
const Footer = ({
|
|
80
|
+
description,
|
|
81
|
+
children,
|
|
82
|
+
iconBefore,
|
|
83
|
+
testId
|
|
84
|
+
}) => {
|
|
85
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
86
|
+
display: "block",
|
|
87
|
+
padding: "space.100",
|
|
88
|
+
testId: testId
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
90
|
+
space: "100",
|
|
91
|
+
alignInline: "center"
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
93
|
+
display: "inlineBlock",
|
|
94
|
+
width: "size.200",
|
|
95
|
+
height: "size.200"
|
|
96
|
+
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
97
|
+
space: "075"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
99
|
+
fontSize: "size.075",
|
|
100
|
+
textAlign: "center",
|
|
101
|
+
lineHeight: "lineHeight.100"
|
|
102
|
+
}, children), description && /*#__PURE__*/React.createElement(Text, {
|
|
103
|
+
lineHeight: "lineHeight.100",
|
|
104
|
+
as: "div",
|
|
105
|
+
fontSize: "size.075",
|
|
106
|
+
textAlign: "center",
|
|
107
|
+
color: "subtlest"
|
|
108
|
+
}, description))));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* __Footer__
|
|
113
|
+
*
|
|
114
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
115
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
116
|
+
*/
|
|
117
|
+
const FooterFacade = ({
|
|
118
|
+
useDeprecatedApi = true,
|
|
119
|
+
description,
|
|
120
|
+
iconBefore,
|
|
121
|
+
testId,
|
|
122
|
+
children,
|
|
123
|
+
component,
|
|
124
|
+
cssFn,
|
|
125
|
+
onClick
|
|
126
|
+
}) => {
|
|
127
|
+
if (!useDeprecatedApi) {
|
|
128
|
+
return /*#__PURE__*/React.createElement(Footer, {
|
|
129
|
+
iconBefore: iconBefore,
|
|
130
|
+
description: description,
|
|
131
|
+
testId: testId
|
|
132
|
+
}, children);
|
|
133
|
+
}
|
|
134
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'CI') {
|
|
135
|
+
warnOnce('The `@atlaskit/side-navigation` Footer has simplified its API, removing support for the `component`, `cssFn` and `onClick` props.\n\nThese props will stop working in a future major release. Reach out to #help-design-system on slack for help.');
|
|
136
|
+
}
|
|
137
|
+
return /*#__PURE__*/React.createElement(OldFooter, {
|
|
138
|
+
onClick: onClick,
|
|
139
|
+
component: component
|
|
140
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
141
|
+
,
|
|
142
|
+
cssFn: cssFn,
|
|
143
|
+
iconBefore: iconBefore,
|
|
144
|
+
description: description,
|
|
145
|
+
testId: testId
|
|
146
|
+
}, children);
|
|
147
|
+
};
|
|
148
|
+
export default FooterFacade;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/react/use-primitives */
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -30,14 +31,11 @@ const SideNavigation = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
30
31
|
testId,
|
|
31
32
|
label
|
|
32
33
|
} = props;
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
css: sideNavStyles
|
|
40
|
-
}, children)
|
|
41
|
-
);
|
|
34
|
+
return jsx("nav", {
|
|
35
|
+
ref: ref,
|
|
36
|
+
"data-testid": testId,
|
|
37
|
+
"aria-label": label,
|
|
38
|
+
css: sideNavStyles
|
|
39
|
+
}, children);
|
|
42
40
|
});
|
|
43
41
|
export default SideNavigation;
|
package/dist/es2019/version.json
CHANGED
|
@@ -51,23 +51,16 @@ export var baseSideNavItemStyle = function baseSideNavItemStyle(_ref) {
|
|
|
51
51
|
return _objectSpread(_objectSpread(_objectSpread({
|
|
52
52
|
// This padding is set to ensure that the center of the left icon
|
|
53
53
|
// is approximately center aligned with the horizontal app switcher.
|
|
54
|
-
|
|
54
|
+
paddingBlock: "var(--ds-space-100, 8px)",
|
|
55
|
+
paddingInline: "var(--ds-space-100, 10px)",
|
|
55
56
|
borderRadius: borderRadius,
|
|
56
57
|
// -- TODO: DELETE THESE COLOR OVERRIDES WHEN CLEANING UP FALLBACK THEMING --
|
|
57
58
|
// Menu and side navigation are now color aligned so they do not need this!
|
|
58
59
|
// See: https://product-fabric.atlassian.net/browse/DSP-1684
|
|
59
60
|
backgroundColor: "var(--ds-background-neutral-subtle, transparent)"
|
|
60
61
|
}, !isDisabled && !isSelected && defaultStyles), !isDisabled && isSelected && selectedStyles), {}, _defineProperty({}, '& [data-item-elem-before]', {
|
|
61
|
-
// TODO: Can this be moved into menu?
|
|
62
|
-
// center align icons with app-switcher regardless of size
|
|
63
|
-
display: 'flex',
|
|
64
62
|
height: "var(--ds-space-300, 24px)",
|
|
65
|
-
width: "var(--ds-space-300, 24px)"
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
justifyContent: 'center',
|
|
68
|
-
// this margin could be removed if the respective item had a more
|
|
69
|
-
// compositional API so an Inline could be used to separate elements instead
|
|
70
|
-
marginRight: "var(--ds-space-200, 16px)"
|
|
63
|
+
width: "var(--ds-space-300, 24px)"
|
|
71
64
|
}));
|
|
72
65
|
};
|
|
73
66
|
export var sectionHeaderSpacingStyles = function sectionHeaderSpacingStyles() {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
5
|
+
import Text from '@atlaskit/ds-explorations/text';
|
|
6
|
+
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
7
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
3
8
|
import { N500 } from '@atlaskit/theme/colors';
|
|
4
9
|
import { overrideStyleFunction } from '../../common/styles';
|
|
5
10
|
import { Container } from '../Header';
|
|
@@ -10,7 +15,7 @@ import { CustomItem } from '../Item';
|
|
|
10
15
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
11
16
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
12
17
|
*/
|
|
13
|
-
var
|
|
18
|
+
var OldFooter = function OldFooter(props) {
|
|
14
19
|
var cssFn = overrideStyleFunction(function () {
|
|
15
20
|
return {
|
|
16
21
|
userSelect: 'auto',
|
|
@@ -67,4 +72,79 @@ var Footer = function Footer(props) {
|
|
|
67
72
|
cssFn: cssFn
|
|
68
73
|
}));
|
|
69
74
|
};
|
|
70
|
-
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* __Footer__
|
|
78
|
+
*
|
|
79
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
80
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
81
|
+
*/
|
|
82
|
+
var Footer = function Footer(_ref2) {
|
|
83
|
+
var description = _ref2.description,
|
|
84
|
+
children = _ref2.children,
|
|
85
|
+
iconBefore = _ref2.iconBefore,
|
|
86
|
+
testId = _ref2.testId;
|
|
87
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
88
|
+
display: "block",
|
|
89
|
+
padding: "space.100",
|
|
90
|
+
testId: testId
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
92
|
+
space: "100",
|
|
93
|
+
alignInline: "center"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
95
|
+
display: "inlineBlock",
|
|
96
|
+
width: "size.200",
|
|
97
|
+
height: "size.200"
|
|
98
|
+
}, iconBefore), /*#__PURE__*/React.createElement(Stack, {
|
|
99
|
+
space: "075"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
101
|
+
fontSize: "size.075",
|
|
102
|
+
textAlign: "center",
|
|
103
|
+
lineHeight: "lineHeight.100"
|
|
104
|
+
}, children), description && /*#__PURE__*/React.createElement(Text, {
|
|
105
|
+
lineHeight: "lineHeight.100",
|
|
106
|
+
as: "div",
|
|
107
|
+
fontSize: "size.075",
|
|
108
|
+
textAlign: "center",
|
|
109
|
+
color: "subtlest"
|
|
110
|
+
}, description))));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* __Footer__
|
|
115
|
+
*
|
|
116
|
+
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
117
|
+
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
118
|
+
*/
|
|
119
|
+
var FooterFacade = function FooterFacade(_ref3) {
|
|
120
|
+
var _ref3$useDeprecatedAp = _ref3.useDeprecatedApi,
|
|
121
|
+
useDeprecatedApi = _ref3$useDeprecatedAp === void 0 ? true : _ref3$useDeprecatedAp,
|
|
122
|
+
description = _ref3.description,
|
|
123
|
+
iconBefore = _ref3.iconBefore,
|
|
124
|
+
testId = _ref3.testId,
|
|
125
|
+
children = _ref3.children,
|
|
126
|
+
component = _ref3.component,
|
|
127
|
+
cssFn = _ref3.cssFn,
|
|
128
|
+
onClick = _ref3.onClick;
|
|
129
|
+
if (!useDeprecatedApi) {
|
|
130
|
+
return /*#__PURE__*/React.createElement(Footer, {
|
|
131
|
+
iconBefore: iconBefore,
|
|
132
|
+
description: description,
|
|
133
|
+
testId: testId
|
|
134
|
+
}, children);
|
|
135
|
+
}
|
|
136
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'CI') {
|
|
137
|
+
warnOnce('The `@atlaskit/side-navigation` Footer has simplified its API, removing support for the `component`, `cssFn` and `onClick` props.\n\nThese props will stop working in a future major release. Reach out to #help-design-system on slack for help.');
|
|
138
|
+
}
|
|
139
|
+
return /*#__PURE__*/React.createElement(OldFooter, {
|
|
140
|
+
onClick: onClick,
|
|
141
|
+
component: component
|
|
142
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
143
|
+
,
|
|
144
|
+
cssFn: cssFn,
|
|
145
|
+
iconBefore: iconBefore,
|
|
146
|
+
description: description,
|
|
147
|
+
testId: testId
|
|
148
|
+
}, children);
|
|
149
|
+
};
|
|
150
|
+
export default FooterFacade;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/react/use-primitives */
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -28,14 +29,11 @@ var SideNavigation = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
28
29
|
var children = props.children,
|
|
29
30
|
testId = props.testId,
|
|
30
31
|
label = props.label;
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
css: sideNavStyles
|
|
38
|
-
}, children)
|
|
39
|
-
);
|
|
32
|
+
return jsx("nav", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
"data-testid": testId,
|
|
35
|
+
"aria-label": label,
|
|
36
|
+
css: sideNavStyles
|
|
37
|
+
}, children);
|
|
40
38
|
});
|
|
41
39
|
export default SideNavigation;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { HeaderProps
|
|
3
|
-
|
|
2
|
+
import { HeaderProps } from '../Header';
|
|
3
|
+
declare type NewFooterProps = Omit<HeaderProps, 'cssFn' | 'component' | 'onClick'>;
|
|
4
|
+
declare 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 declare type FooterProps = HeaderProps | NewFooterProps;
|
|
4
21
|
/**
|
|
5
22
|
* __Footer__
|
|
6
23
|
*
|
|
7
24
|
* - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
|
|
8
25
|
* - [Code](https://atlassian.design/components/side-navigation/code)
|
|
9
26
|
*/
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
27
|
+
declare const FooterFacade: ({ useDeprecatedApi, description, iconBefore, testId, children, component, cssFn, onClick, }: FooterFacadeProps) => JSX.Element;
|
|
28
|
+
export default FooterFacade;
|
|
@@ -6,7 +6,7 @@ import { CSSFn, CustomItemComponentProps } from '@atlaskit/menu';
|
|
|
6
6
|
* A container for Header and Footer that safely handles props to the child component
|
|
7
7
|
*/
|
|
8
8
|
export declare const Container: React.FC<CustomItemComponentProps>;
|
|
9
|
-
export
|
|
9
|
+
export declare type HeaderProps = {
|
|
10
10
|
/**
|
|
11
11
|
* A function that can be used to override the styles of the component.
|
|
12
12
|
* It receives the current styles and state and expects a styles object.
|
|
@@ -41,11 +41,10 @@ export interface HeaderProps {
|
|
|
41
41
|
* Custom component to render as an item.
|
|
42
42
|
* This can be both a functional component or a class component.
|
|
43
43
|
* __Will return `null` if no component is defined.__
|
|
44
|
-
*
|
|
45
44
|
* __NOTE:__ Make sure the reference for this component does not change between renders else undefined behavior may happen.
|
|
46
45
|
*/
|
|
47
46
|
component?: React.ComponentType<CustomItemComponentProps>;
|
|
48
|
-
}
|
|
47
|
+
};
|
|
49
48
|
/**
|
|
50
49
|
* __Header__
|
|
51
50
|
*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required */
|
|
2
|
+
/* eslint-disable @repo/internal/react/boolean-prop-naming-convention */
|
|
3
|
+
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
4
|
+
|
|
5
|
+
import { HeaderProps } from '../../src/components/Header';
|
|
6
|
+
|
|
7
|
+
interface FooterProps extends HeaderProps {
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated
|
|
10
|
+
* Enables use of deprecated `cssFn`, `onClick` and `component` props.
|
|
11
|
+
* If this prop is not set to true, you will see a deprecation warning.
|
|
12
|
+
*/
|
|
13
|
+
useDeprecatedApi?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default (props: FooterProps) => null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/side-navigation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "A highly composable side navigation component that supports nested views.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
|
-
"disableProductCI": true,
|
|
19
18
|
"team": "Design System Team",
|
|
20
19
|
"deprecatedAutoEntryPoints": true,
|
|
21
20
|
"releaseModel": "scheduled",
|
|
@@ -28,10 +27,11 @@
|
|
|
28
27
|
"@atlaskit/ds-explorations": "^2.0.0",
|
|
29
28
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
30
29
|
"@atlaskit/icon": "^21.11.0",
|
|
31
|
-
"@atlaskit/menu": "^1.
|
|
30
|
+
"@atlaskit/menu": "^1.5.0",
|
|
32
31
|
"@atlaskit/motion": "^1.3.0",
|
|
33
|
-
"@atlaskit/
|
|
34
|
-
"@atlaskit/
|
|
32
|
+
"@atlaskit/primitives": "^0.4.0",
|
|
33
|
+
"@atlaskit/theme": "^12.3.0",
|
|
34
|
+
"@atlaskit/tokens": "^1.2.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@emotion/react": "^11.7.1"
|
|
37
37
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/atlassian-navigation": "^2.3.0",
|
|
43
43
|
"@atlaskit/button": "^16.5.0",
|
|
44
44
|
"@atlaskit/docs": "*",
|
|
45
|
-
"@atlaskit/logo": "^13.
|
|
45
|
+
"@atlaskit/logo": "^13.11.0",
|
|
46
46
|
"@atlaskit/onboarding": "^10.6.0",
|
|
47
47
|
"@atlaskit/section-message": "^6.3.0",
|
|
48
48
|
"@atlaskit/select": "^16.1.0",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"lite-mode"
|
|
72
72
|
],
|
|
73
73
|
"design-tokens": [
|
|
74
|
+
"color",
|
|
74
75
|
"spacing"
|
|
75
76
|
],
|
|
76
77
|
"analytics": "analytics-next",
|
|
77
|
-
"theming": "tokens",
|
|
78
78
|
"deprecation": "no-deprecated-imports"
|
|
79
79
|
}
|
|
80
80
|
},
|