@atlaskit/menu 1.2.4 → 1.3.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 +28 -0
- package/dist/cjs/internal/components/menu-item-primitive.js +13 -11
- package/dist/cjs/menu-item/heading-item.js +1 -1
- package/dist/cjs/menu-item/skeleton-heading-item.js +1 -1
- package/dist/cjs/menu-item/skeleton-item.js +2 -2
- package/dist/cjs/menu-section/menu-group.js +5 -2
- package/dist/cjs/menu-section/popup-menu-group.js +6 -4
- package/dist/cjs/menu-section/section.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/components/menu-item-primitive.js +12 -11
- package/dist/es2019/menu-item/heading-item.js +2 -2
- package/dist/es2019/menu-item/skeleton-heading-item.js +1 -1
- package/dist/es2019/menu-item/skeleton-item.js +2 -2
- package/dist/es2019/menu-section/menu-group.js +4 -1
- package/dist/es2019/menu-section/popup-menu-group.js +2 -1
- package/dist/es2019/menu-section/section.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/components/menu-item-primitive.js +13 -11
- package/dist/esm/menu-item/heading-item.js +2 -2
- package/dist/esm/menu-item/skeleton-heading-item.js +1 -1
- package/dist/esm/menu-item/skeleton-item.js +2 -2
- package/dist/esm/menu-section/menu-group.js +5 -2
- package/dist/esm/menu-section/popup-menu-group.js +6 -4
- package/dist/esm/menu-section/section.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/menu-section/menu-group.d.ts +1 -1
- package/dist/types/types.d.ts +30 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`77c46ec96a7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/77c46ec96a7) - Adds a prop for `role` to the MenuGroup component that acts as you'd expect the HTML attribute to act. You are now able to override the accessibility role for the element.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.2.6
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`58884c2f6c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/58884c2f6c1) - Internal code change turning on a new linting rule.
|
|
18
|
+
- [`27467f65f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/27467f65f68) - [ux] Update headingStyle to color that passes WCAG AA color contrast
|
|
19
|
+
- [`2066efabc65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2066efabc65) - A fix for the `StatelessCSSFn` type so that it now correctly accetps a void argument.
|
|
20
|
+
- [`96cfc6c1c7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/96cfc6c1c7f) - Deprecates the `cssFn` and `overrides` APIs in '@atlaskit/menu'. These APIs are not performant and allow unbounded customisation of the Menu components. These APIs will be removed in a future release.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
23
|
+
## 1.2.5
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
28
|
+
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
3
31
|
## 1.2.4
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -21,7 +21,9 @@ var _typography = require("@atlaskit/theme/typography");
|
|
|
21
21
|
|
|
22
22
|
/** @jsx jsx */
|
|
23
23
|
var defaultRender = function defaultRender(Component, props) {
|
|
24
|
-
return (
|
|
24
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
25
|
+
(0, _core.jsx)(Component, props)
|
|
26
|
+
);
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
var gridSize = (0, _constants.gridSize)();
|
|
@@ -65,7 +67,7 @@ var wordBreakStyles = (0, _core.css)({
|
|
|
65
67
|
});
|
|
66
68
|
var descriptionStyles = (0, _core.css)({
|
|
67
69
|
marginTop: itemDescriptionSpacing,
|
|
68
|
-
color: "var(--ds-text-
|
|
70
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
69
71
|
fontSize: _typography.headingSizes.h200.size
|
|
70
72
|
});
|
|
71
73
|
var primitiveStyles = (0, _core.css)({
|
|
@@ -98,11 +100,11 @@ var unselectedStyles = (0, _core.css)({
|
|
|
98
100
|
color: 'currentColor'
|
|
99
101
|
},
|
|
100
102
|
':hover': {
|
|
101
|
-
backgroundColor: "var(--ds-background-
|
|
103
|
+
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"),
|
|
102
104
|
color: 'currentColor'
|
|
103
105
|
},
|
|
104
106
|
':active': {
|
|
105
|
-
backgroundColor: "var(--ds-background-
|
|
107
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.N30, ")"),
|
|
106
108
|
boxShadow: 'none',
|
|
107
109
|
color: 'currentColor'
|
|
108
110
|
}
|
|
@@ -115,19 +117,19 @@ var disabledStyles = (0, _core.css)({
|
|
|
115
117
|
}
|
|
116
118
|
});
|
|
117
119
|
var selectedStyles = (0, _core.css)({
|
|
118
|
-
backgroundColor: "var(--ds-background-
|
|
120
|
+
backgroundColor: "var(--ds-background-brand, ".concat(_colors.N20, ")"),
|
|
119
121
|
// Fallback set as babel plugin inserts one otherwise
|
|
120
|
-
color: "var(--ds-text-
|
|
122
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
121
123
|
':visited': {
|
|
122
|
-
color: "var(--ds-text-
|
|
124
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
123
125
|
},
|
|
124
126
|
':hover': {
|
|
125
|
-
backgroundColor: "var(--ds-background-
|
|
126
|
-
color: "var(--ds-text-
|
|
127
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat(_colors.N20, ")"),
|
|
128
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
127
129
|
},
|
|
128
130
|
':active': {
|
|
129
|
-
backgroundColor: "var(--ds-background-
|
|
130
|
-
color: "var(--ds-text-
|
|
131
|
+
backgroundColor: "var(--ds-background-brand-pressed, ".concat(_colors.N30, ")"),
|
|
132
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
131
133
|
}
|
|
132
134
|
});
|
|
133
135
|
/**
|
|
@@ -30,7 +30,7 @@ var itemHeadingContentHeight = _typography.headingSizes.h100.lineHeight;
|
|
|
30
30
|
var itemHeadingFontSize = _typography.headingSizes.h100.size;
|
|
31
31
|
var headingStyles = (0, _core.css)({
|
|
32
32
|
padding: "0 ".concat(itemSidePadding, "px"),
|
|
33
|
-
color: "var(--ds-text-
|
|
33
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N300, ")"),
|
|
34
34
|
fontSize: itemHeadingFontSize,
|
|
35
35
|
fontWeight: 700,
|
|
36
36
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -22,7 +22,7 @@ var skeletonStyles = (0, _core.css)({
|
|
|
22
22
|
display: 'block',
|
|
23
23
|
width: '30%',
|
|
24
24
|
height: (0, _constants.gridSize)(),
|
|
25
|
-
backgroundColor: "var(--ds-background-
|
|
25
|
+
backgroundColor: "var(--ds-background-neutral, ".concat((0, _colors.skeleton)(), ")"),
|
|
26
26
|
borderRadius: 100,
|
|
27
27
|
content: '""'
|
|
28
28
|
}
|
|
@@ -26,7 +26,7 @@ var skeletonItemElemSize = gridSize * 2.5;
|
|
|
26
26
|
var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
27
27
|
var skeletonTextBorderRadius = 100;
|
|
28
28
|
var skeletonContentHeight = 9;
|
|
29
|
-
var skeletonColor = "var(--ds-background-
|
|
29
|
+
var skeletonColor = "var(--ds-background-neutral, ".concat((0, _colors.skeleton)(), ")");
|
|
30
30
|
var skeletonStyles = (0, _core.css)({
|
|
31
31
|
display: 'flex',
|
|
32
32
|
minHeight: itemMinHeight,
|
|
@@ -111,7 +111,7 @@ var SkeletonItem = function SkeletonItem(_ref) {
|
|
|
111
111
|
'--width': width
|
|
112
112
|
},
|
|
113
113
|
css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
114
|
-
cssFn(
|
|
114
|
+
cssFn()],
|
|
115
115
|
"data-testid": testId
|
|
116
116
|
});
|
|
117
117
|
};
|
|
@@ -13,7 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _core = require("@emotion/core");
|
|
15
15
|
|
|
16
|
-
var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"];
|
|
16
|
+
var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId", "role"];
|
|
17
17
|
var groupStyles = (0, _core.css)({
|
|
18
18
|
display: 'flex',
|
|
19
19
|
flexDirection: 'column',
|
|
@@ -34,6 +34,7 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
34
34
|
minHeight = _ref.minHeight,
|
|
35
35
|
maxHeight = _ref.maxHeight,
|
|
36
36
|
testId = _ref.testId,
|
|
37
|
+
role = _ref.role,
|
|
37
38
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
39
|
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
39
40
|
style: {
|
|
@@ -43,7 +44,9 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
43
44
|
maxHeight: maxHeight
|
|
44
45
|
},
|
|
45
46
|
css: groupStyles,
|
|
46
|
-
"data-testid": testId
|
|
47
|
+
"data-testid": testId,
|
|
48
|
+
role: role // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
49
|
+
|
|
47
50
|
}, rest));
|
|
48
51
|
};
|
|
49
52
|
|
|
@@ -26,10 +26,12 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
|
|
|
26
26
|
_ref$minWidth = _ref.minWidth,
|
|
27
27
|
minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
|
|
28
28
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
30
|
+
(0, _core.jsx)(_menuGroup.default, (0, _extends2.default)({
|
|
31
|
+
maxWidth: maxWidth,
|
|
32
|
+
minWidth: minWidth
|
|
33
|
+
}, rest))
|
|
34
|
+
);
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
var _default = PopupMenuGroup;
|
|
@@ -76,7 +76,7 @@ var unscrollableStyles = (0, _core.css)({
|
|
|
76
76
|
flexShrink: 0
|
|
77
77
|
});
|
|
78
78
|
var separatorStyles = (0, _core.css)({
|
|
79
|
-
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border
|
|
79
|
+
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border, ".concat(_colors.N30A, ")"), ")")
|
|
80
80
|
});
|
|
81
81
|
var noSeparatorStyles = (0, _core.css)({
|
|
82
82
|
// this is to ensure that adjacent sections without separators don't get additional margins.
|
package/dist/cjs/version.json
CHANGED
|
@@ -6,7 +6,8 @@ import { N20, N200, N30 } from '@atlaskit/theme/colors';
|
|
|
6
6
|
import { fontSize as fontSizeFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
7
7
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
8
8
|
|
|
9
|
-
const defaultRender = (Component, props) =>
|
|
9
|
+
const defaultRender = (Component, props) => // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
10
|
+
jsx(Component, props);
|
|
10
11
|
|
|
11
12
|
const gridSize = gridSizeFn();
|
|
12
13
|
const fontSize = fontSizeFn();
|
|
@@ -49,7 +50,7 @@ const wordBreakStyles = css({
|
|
|
49
50
|
});
|
|
50
51
|
const descriptionStyles = css({
|
|
51
52
|
marginTop: itemDescriptionSpacing,
|
|
52
|
-
color: `var(--ds-text-
|
|
53
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
53
54
|
fontSize: headingSizes.h200.size
|
|
54
55
|
});
|
|
55
56
|
const primitiveStyles = css({
|
|
@@ -82,11 +83,11 @@ const unselectedStyles = css({
|
|
|
82
83
|
color: 'currentColor'
|
|
83
84
|
},
|
|
84
85
|
':hover': {
|
|
85
|
-
backgroundColor: `var(--ds-background-
|
|
86
|
+
backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N20})`,
|
|
86
87
|
color: 'currentColor'
|
|
87
88
|
},
|
|
88
89
|
':active': {
|
|
89
|
-
backgroundColor: `var(--ds-background-
|
|
90
|
+
backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${N30})`,
|
|
90
91
|
boxShadow: 'none',
|
|
91
92
|
color: 'currentColor'
|
|
92
93
|
}
|
|
@@ -99,19 +100,19 @@ const disabledStyles = css({
|
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
const selectedStyles = css({
|
|
102
|
-
backgroundColor: `var(--ds-background-
|
|
103
|
+
backgroundColor: `var(--ds-background-brand, ${N20})`,
|
|
103
104
|
// Fallback set as babel plugin inserts one otherwise
|
|
104
|
-
color: "var(--ds-text-
|
|
105
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
105
106
|
':visited': {
|
|
106
|
-
color: "var(--ds-text-
|
|
107
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
107
108
|
},
|
|
108
109
|
':hover': {
|
|
109
|
-
backgroundColor: `var(--ds-background-
|
|
110
|
-
color: "var(--ds-text-
|
|
110
|
+
backgroundColor: `var(--ds-background-brand-hovered, ${N20})`,
|
|
111
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
111
112
|
},
|
|
112
113
|
':active': {
|
|
113
|
-
backgroundColor: `var(--ds-background-
|
|
114
|
-
color: "var(--ds-text-
|
|
114
|
+
backgroundColor: `var(--ds-background-brand-pressed, ${N30})`,
|
|
115
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
/**
|
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
|
-
import {
|
|
7
|
+
import { N300 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
9
9
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
10
10
|
const gridSize = gridSizeFn();
|
|
@@ -13,7 +13,7 @@ const itemHeadingContentHeight = headingSizes.h100.lineHeight;
|
|
|
13
13
|
const itemHeadingFontSize = headingSizes.h100.size;
|
|
14
14
|
const headingStyles = css({
|
|
15
15
|
padding: `0 ${itemSidePadding}px`,
|
|
16
|
-
color: `var(--ds-text-
|
|
16
|
+
color: `var(--ds-text-subtle, ${N300})`,
|
|
17
17
|
fontSize: itemHeadingFontSize,
|
|
18
18
|
fontWeight: 700,
|
|
19
19
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -9,7 +9,7 @@ const skeletonStyles = css({
|
|
|
9
9
|
display: 'block',
|
|
10
10
|
width: '30%',
|
|
11
11
|
height: gridSize(),
|
|
12
|
-
backgroundColor: `var(--ds-background-
|
|
12
|
+
backgroundColor: `var(--ds-background-neutral, ${skeletonColorFn()})`,
|
|
13
13
|
borderRadius: 100,
|
|
14
14
|
content: '""'
|
|
15
15
|
}
|
|
@@ -13,7 +13,7 @@ const skeletonItemElemSize = gridSize * 2.5;
|
|
|
13
13
|
const itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
14
14
|
const skeletonTextBorderRadius = 100;
|
|
15
15
|
const skeletonContentHeight = 9;
|
|
16
|
-
const skeletonColor = `var(--ds-background-
|
|
16
|
+
const skeletonColor = `var(--ds-background-neutral, ${skeletonColorFn()})`;
|
|
17
17
|
const skeletonStyles = css({
|
|
18
18
|
display: 'flex',
|
|
19
19
|
minHeight: itemMinHeight,
|
|
@@ -97,7 +97,7 @@ const SkeletonItem = ({
|
|
|
97
97
|
'--width': width
|
|
98
98
|
},
|
|
99
99
|
css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
100
|
-
cssFn(
|
|
100
|
+
cssFn()],
|
|
101
101
|
"data-testid": testId
|
|
102
102
|
});
|
|
103
103
|
|
|
@@ -22,6 +22,7 @@ const MenuGroup = ({
|
|
|
22
22
|
minHeight,
|
|
23
23
|
maxHeight,
|
|
24
24
|
testId,
|
|
25
|
+
role,
|
|
25
26
|
...rest
|
|
26
27
|
}) => jsx("div", _extends({
|
|
27
28
|
style: {
|
|
@@ -31,7 +32,9 @@ const MenuGroup = ({
|
|
|
31
32
|
maxHeight
|
|
32
33
|
},
|
|
33
34
|
css: groupStyles,
|
|
34
|
-
"data-testid": testId
|
|
35
|
+
"data-testid": testId,
|
|
36
|
+
role: role // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
37
|
+
|
|
35
38
|
}, rest));
|
|
36
39
|
|
|
37
40
|
export default MenuGroup;
|
|
@@ -11,7 +11,8 @@ const PopupMenuGroup = ({
|
|
|
11
11
|
maxWidth = 800,
|
|
12
12
|
minWidth = 320,
|
|
13
13
|
...rest
|
|
14
|
-
}) =>
|
|
14
|
+
}) => // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
15
|
+
jsx(MenuGroup, _extends({
|
|
15
16
|
maxWidth: maxWidth,
|
|
16
17
|
minWidth: minWidth
|
|
17
18
|
}, rest));
|
|
@@ -59,7 +59,7 @@ const unscrollableStyles = css({
|
|
|
59
59
|
flexShrink: 0
|
|
60
60
|
});
|
|
61
61
|
const separatorStyles = css({
|
|
62
|
-
borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border
|
|
62
|
+
borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border, ${N30A})`})`
|
|
63
63
|
});
|
|
64
64
|
const noSeparatorStyles = css({
|
|
65
65
|
// this is to ensure that adjacent sections without separators don't get additional margins.
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,7 +7,9 @@ import { fontSize as fontSizeFn, gridSize as gridSizeFn } from '@atlaskit/theme/
|
|
|
7
7
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
8
8
|
|
|
9
9
|
var defaultRender = function defaultRender(Component, props) {
|
|
10
|
-
return
|
|
10
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
11
|
+
jsx(Component, props)
|
|
12
|
+
);
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
var gridSize = gridSizeFn();
|
|
@@ -51,7 +53,7 @@ var wordBreakStyles = css({
|
|
|
51
53
|
});
|
|
52
54
|
var descriptionStyles = css({
|
|
53
55
|
marginTop: itemDescriptionSpacing,
|
|
54
|
-
color: "var(--ds-text-
|
|
56
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
55
57
|
fontSize: headingSizes.h200.size
|
|
56
58
|
});
|
|
57
59
|
var primitiveStyles = css({
|
|
@@ -84,11 +86,11 @@ var unselectedStyles = css({
|
|
|
84
86
|
color: 'currentColor'
|
|
85
87
|
},
|
|
86
88
|
':hover': {
|
|
87
|
-
backgroundColor: "var(--ds-background-
|
|
89
|
+
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"),
|
|
88
90
|
color: 'currentColor'
|
|
89
91
|
},
|
|
90
92
|
':active': {
|
|
91
|
-
backgroundColor: "var(--ds-background-
|
|
93
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(N30, ")"),
|
|
92
94
|
boxShadow: 'none',
|
|
93
95
|
color: 'currentColor'
|
|
94
96
|
}
|
|
@@ -101,19 +103,19 @@ var disabledStyles = css({
|
|
|
101
103
|
}
|
|
102
104
|
});
|
|
103
105
|
var selectedStyles = css({
|
|
104
|
-
backgroundColor: "var(--ds-background-
|
|
106
|
+
backgroundColor: "var(--ds-background-brand, ".concat(N20, ")"),
|
|
105
107
|
// Fallback set as babel plugin inserts one otherwise
|
|
106
|
-
color: "var(--ds-text-
|
|
108
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
107
109
|
':visited': {
|
|
108
|
-
color: "var(--ds-text-
|
|
110
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
109
111
|
},
|
|
110
112
|
':hover': {
|
|
111
|
-
backgroundColor: "var(--ds-background-
|
|
112
|
-
color: "var(--ds-text-
|
|
113
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat(N20, ")"),
|
|
114
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
113
115
|
},
|
|
114
116
|
':active': {
|
|
115
|
-
backgroundColor: "var(--ds-background-
|
|
116
|
-
color: "var(--ds-text-
|
|
117
|
+
backgroundColor: "var(--ds-background-brand-pressed, ".concat(N30, ")"),
|
|
118
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
117
119
|
}
|
|
118
120
|
});
|
|
119
121
|
/**
|
|
@@ -6,7 +6,7 @@ var _excluded = ["children", "testId", "id", "cssFn"];
|
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/core';
|
|
8
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
9
|
-
import {
|
|
9
|
+
import { N300 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
11
11
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
12
12
|
var gridSize = gridSizeFn();
|
|
@@ -15,7 +15,7 @@ var itemHeadingContentHeight = headingSizes.h100.lineHeight;
|
|
|
15
15
|
var itemHeadingFontSize = headingSizes.h100.size;
|
|
16
16
|
var headingStyles = css({
|
|
17
17
|
padding: "0 ".concat(itemSidePadding, "px"),
|
|
18
|
-
color: "var(--ds-text-
|
|
18
|
+
color: "var(--ds-text-subtle, ".concat(N300, ")"),
|
|
19
19
|
fontSize: itemHeadingFontSize,
|
|
20
20
|
fontWeight: 700,
|
|
21
21
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -9,7 +9,7 @@ var skeletonStyles = css({
|
|
|
9
9
|
display: 'block',
|
|
10
10
|
width: '30%',
|
|
11
11
|
height: gridSize(),
|
|
12
|
-
backgroundColor: "var(--ds-background-
|
|
12
|
+
backgroundColor: "var(--ds-background-neutral, ".concat(skeletonColorFn(), ")"),
|
|
13
13
|
borderRadius: 100,
|
|
14
14
|
content: '""'
|
|
15
15
|
}
|
|
@@ -13,7 +13,7 @@ var skeletonItemElemSize = gridSize * 2.5;
|
|
|
13
13
|
var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
14
14
|
var skeletonTextBorderRadius = 100;
|
|
15
15
|
var skeletonContentHeight = 9;
|
|
16
|
-
var skeletonColor = "var(--ds-background-
|
|
16
|
+
var skeletonColor = "var(--ds-background-neutral, ".concat(skeletonColorFn(), ")");
|
|
17
17
|
var skeletonStyles = css({
|
|
18
18
|
display: 'flex',
|
|
19
19
|
minHeight: itemMinHeight,
|
|
@@ -98,7 +98,7 @@ var SkeletonItem = function SkeletonItem(_ref) {
|
|
|
98
98
|
'--width': width
|
|
99
99
|
},
|
|
100
100
|
css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
101
|
-
cssFn(
|
|
101
|
+
cssFn()],
|
|
102
102
|
"data-testid": testId
|
|
103
103
|
});
|
|
104
104
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"];
|
|
3
|
+
var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId", "role"];
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { css, jsx } from '@emotion/core';
|
|
@@ -24,6 +24,7 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
24
24
|
minHeight = _ref.minHeight,
|
|
25
25
|
maxHeight = _ref.maxHeight,
|
|
26
26
|
testId = _ref.testId,
|
|
27
|
+
role = _ref.role,
|
|
27
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
29
|
|
|
29
30
|
return jsx("div", _extends({
|
|
@@ -34,7 +35,9 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
34
35
|
maxHeight: maxHeight
|
|
35
36
|
},
|
|
36
37
|
css: groupStyles,
|
|
37
|
-
"data-testid": testId
|
|
38
|
+
"data-testid": testId,
|
|
39
|
+
role: role // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
40
|
+
|
|
38
41
|
}, rest));
|
|
39
42
|
};
|
|
40
43
|
|
|
@@ -16,10 +16,12 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
|
|
|
16
16
|
minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
|
|
17
17
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
18
|
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
20
|
+
jsx(MenuGroup, _extends({
|
|
21
|
+
maxWidth: maxWidth,
|
|
22
|
+
minWidth: minWidth
|
|
23
|
+
}, rest))
|
|
24
|
+
);
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
export default PopupMenuGroup;
|
|
@@ -61,7 +61,7 @@ var unscrollableStyles = css({
|
|
|
61
61
|
flexShrink: 0
|
|
62
62
|
});
|
|
63
63
|
var separatorStyles = css({
|
|
64
|
-
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border
|
|
64
|
+
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border, ".concat(N30A, ")"), ")")
|
|
65
65
|
});
|
|
66
66
|
var noSeparatorStyles = css({
|
|
67
67
|
// this is to ensure that adjacent sections without separators don't get additional margins.
|
package/dist/esm/version.json
CHANGED
|
@@ -8,5 +8,5 @@ import type { MenuGroupProps } from '../types';
|
|
|
8
8
|
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/menu-group)
|
|
9
9
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
10
10
|
*/
|
|
11
|
-
declare const MenuGroup: ({ maxWidth, minWidth, minHeight, maxHeight, testId, ...rest }: MenuGroupProps) => JSX.Element;
|
|
11
|
+
declare const MenuGroup: ({ maxWidth, minWidth, minHeight, maxHeight, testId, role, ...rest }: MenuGroupProps) => JSX.Element;
|
|
12
12
|
export default MenuGroup;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { CSSObject } from '@emotion/core';
|
|
|
3
3
|
export interface RenderFunction<TProps = {}> {
|
|
4
4
|
(Component: ComponentType | string, props: TProps): React.ReactNode;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
8
|
+
*/
|
|
6
9
|
export interface TitleOverrides {
|
|
7
10
|
render?: RenderFunction<{
|
|
8
11
|
className?: string;
|
|
@@ -10,6 +13,9 @@ export interface TitleOverrides {
|
|
|
10
13
|
'data-item-title': boolean;
|
|
11
14
|
}>;
|
|
12
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
18
|
+
*/
|
|
13
19
|
export interface Overrides {
|
|
14
20
|
Title?: TitleOverrides;
|
|
15
21
|
}
|
|
@@ -39,6 +45,10 @@ export interface MenuGroupProps extends MenuGroupSizing {
|
|
|
39
45
|
* should generally be `Section` components.
|
|
40
46
|
*/
|
|
41
47
|
children: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Used to override the accessibility role for the element.
|
|
50
|
+
*/
|
|
51
|
+
role?: string;
|
|
42
52
|
/**
|
|
43
53
|
* A `testId` prop is provided for specified elements,
|
|
44
54
|
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -78,6 +88,9 @@ export interface SectionProps {
|
|
|
78
88
|
* serving as a hook for automated tests.
|
|
79
89
|
*/
|
|
80
90
|
testId?: string;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
93
|
+
*/
|
|
81
94
|
overrides?: {
|
|
82
95
|
HeadingItem?: {
|
|
83
96
|
/**
|
|
@@ -102,6 +115,9 @@ export interface MenuItemPrimitiveProps {
|
|
|
102
115
|
description: React.ReactNode | undefined;
|
|
103
116
|
iconAfter: React.ReactNode | undefined;
|
|
104
117
|
iconBefore: React.ReactNode | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
120
|
+
*/
|
|
105
121
|
overrides: Overrides | undefined;
|
|
106
122
|
shouldTitleWrap: boolean | undefined;
|
|
107
123
|
shouldDescriptionWrap: boolean | undefined;
|
|
@@ -113,6 +129,8 @@ export interface MenuItemProps {
|
|
|
113
129
|
/**
|
|
114
130
|
* A function that can be used to override the styles of the component.
|
|
115
131
|
* It receives the current styles and state and expects a styles object.
|
|
132
|
+
*
|
|
133
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
116
134
|
*/
|
|
117
135
|
cssFn?: CSSFn;
|
|
118
136
|
/**
|
|
@@ -158,6 +176,8 @@ export interface MenuItemProps {
|
|
|
158
176
|
testId?: string;
|
|
159
177
|
/**
|
|
160
178
|
* Custom overrides for the composed components.
|
|
179
|
+
*
|
|
180
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
161
181
|
*/
|
|
162
182
|
overrides?: Overrides;
|
|
163
183
|
/**
|
|
@@ -294,6 +314,8 @@ export interface HeadingItemProps {
|
|
|
294
314
|
/**
|
|
295
315
|
* A function that can be used to override the styles.
|
|
296
316
|
* It receives the current styles and returns a customised styles object.
|
|
317
|
+
*
|
|
318
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
297
319
|
*/
|
|
298
320
|
cssFn?: StatelessCSSFn;
|
|
299
321
|
/**
|
|
@@ -333,6 +355,8 @@ export interface SkeletonHeadingItemProps {
|
|
|
333
355
|
/**
|
|
334
356
|
* A function that can be used to override the styles of this component.
|
|
335
357
|
* It receives the current styles and returns a customized styles object.
|
|
358
|
+
*
|
|
359
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
336
360
|
*/
|
|
337
361
|
cssFn?: StatelessCSSFn;
|
|
338
362
|
}
|
|
@@ -346,8 +370,12 @@ export declare type ItemState = {
|
|
|
346
370
|
* and should return a CSSObject.
|
|
347
371
|
*
|
|
348
372
|
* @see @atlaskit/menu/docs/85-overriding-item-styles
|
|
373
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
349
374
|
*/
|
|
350
|
-
export interface CSSFn<TState = ItemState> {
|
|
375
|
+
export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
|
|
351
376
|
(currentState: TState): CSSObject | CSSObject[];
|
|
352
377
|
}
|
|
353
|
-
|
|
378
|
+
/**
|
|
379
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
380
|
+
*/
|
|
381
|
+
export declare type StatelessCSSFn = CSSFn<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/menu",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A collection of composable menu components that can be used anywhere.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
".": "./src/index.tsx"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@atlaskit/ds-lib": "^1.
|
|
39
|
-
"@atlaskit/focus-ring": "^0.
|
|
38
|
+
"@atlaskit/ds-lib": "^1.4.0",
|
|
39
|
+
"@atlaskit/focus-ring": "^1.0.0",
|
|
40
40
|
"@atlaskit/theme": "^12.1.0",
|
|
41
|
-
"@atlaskit/tokens": "^0.
|
|
41
|
+
"@atlaskit/tokens": "^0.7.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/core": "^10.0.9"
|
|
44
44
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@atlaskit/avatar": "^20.5.0",
|
|
51
|
-
"@atlaskit/button": "^16.
|
|
51
|
+
"@atlaskit/button": "^16.2.0",
|
|
52
52
|
"@atlaskit/docs": "*",
|
|
53
53
|
"@atlaskit/icon": "^21.10.0",
|
|
54
54
|
"@atlaskit/icon-file-type": "^6.0.0",
|