@atlaskit/menu 1.2.2 → 1.2.6
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 +31 -0
- package/dist/cjs/index.js +14 -14
- package/dist/cjs/internal/components/menu-item-primitive.js +15 -20
- package/dist/cjs/menu-item/button-item.js +2 -2
- package/dist/cjs/menu-item/custom-item.js +3 -2
- package/dist/cjs/menu-item/heading-item.js +3 -5
- package/dist/cjs/menu-item/link-item.js +3 -2
- package/dist/cjs/menu-item/skeleton-heading-item.js +1 -3
- package/dist/cjs/menu-item/skeleton-item.js +2 -4
- package/dist/cjs/menu-section/menu-group.js +4 -3
- package/dist/cjs/menu-section/popup-menu-group.js +8 -6
- package/dist/cjs/menu-section/section.js +3 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/components/menu-item-primitive.js +14 -19
- package/dist/es2019/menu-item/heading-item.js +2 -3
- package/dist/es2019/menu-item/skeleton-heading-item.js +1 -2
- package/dist/es2019/menu-item/skeleton-item.js +2 -3
- package/dist/es2019/menu-section/menu-group.js +2 -1
- package/dist/es2019/menu-section/popup-menu-group.js +2 -1
- package/dist/es2019/menu-section/section.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/components/menu-item-primitive.js +15 -19
- package/dist/esm/menu-item/button-item.js +2 -1
- package/dist/esm/menu-item/custom-item.js +2 -1
- package/dist/esm/menu-item/heading-item.js +4 -4
- package/dist/esm/menu-item/link-item.js +2 -1
- package/dist/esm/menu-item/skeleton-heading-item.js +1 -2
- package/dist/esm/menu-item/skeleton-item.js +2 -3
- package/dist/esm/menu-section/menu-group.js +4 -2
- package/dist/esm/menu-section/popup-menu-group.js +8 -5
- package/dist/esm/menu-section/section.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/components/menu-item-primitive.d.ts +1 -0
- package/dist/types/menu-item/custom-item.d.ts +1 -0
- package/dist/types/menu-item/skeleton-heading-item.d.ts +1 -0
- package/dist/types/menu-item/skeleton-item.d.ts +1 -0
- package/dist/types/menu-section/menu-group.d.ts +1 -0
- package/dist/types/menu-section/popup-menu-group.d.ts +1 -0
- package/dist/types/types.d.ts +26 -2
- package/package.json +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 1.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`58884c2f6c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/58884c2f6c1) - Internal code change turning on a new linting rule.
|
|
8
|
+
- [`27467f65f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/27467f65f68) - [ux] Update headingStyle to color that passes WCAG AA color contrast
|
|
9
|
+
- [`2066efabc65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2066efabc65) - A fix for the `StatelessCSSFn` type so that it now correctly accetps a void argument.
|
|
10
|
+
- [`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.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.2.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`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.
|
|
18
|
+
- [`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.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 1.2.4
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
27
|
+
## 1.2.3
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
3
34
|
## 1.2.2
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,34 +11,34 @@ Object.defineProperty(exports, "ButtonItem", {
|
|
|
11
11
|
return _buttonItem.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "CustomItem", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return
|
|
17
|
+
return _customItem.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
Object.defineProperty(exports, "
|
|
20
|
+
Object.defineProperty(exports, "HeadingItem", {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function get() {
|
|
23
|
-
return
|
|
23
|
+
return _headingItem.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "LinkItem", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _linkItem.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "
|
|
32
|
+
Object.defineProperty(exports, "MenuGroup", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
|
-
return
|
|
35
|
+
return _menuGroup.default;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
Object.defineProperty(exports, "
|
|
38
|
+
Object.defineProperty(exports, "PopupMenuGroup", {
|
|
39
39
|
enumerable: true,
|
|
40
40
|
get: function get() {
|
|
41
|
-
return
|
|
41
|
+
return _popupMenuGroup.default;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "Section", {
|
|
@@ -47,16 +47,16 @@ Object.defineProperty(exports, "Section", {
|
|
|
47
47
|
return _section.default;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
Object.defineProperty(exports, "
|
|
50
|
+
Object.defineProperty(exports, "SkeletonHeadingItem", {
|
|
51
51
|
enumerable: true,
|
|
52
52
|
get: function get() {
|
|
53
|
-
return
|
|
53
|
+
return _skeletonHeadingItem.default;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
Object.defineProperty(exports, "
|
|
56
|
+
Object.defineProperty(exports, "SkeletonItem", {
|
|
57
57
|
enumerable: true,
|
|
58
58
|
get: function get() {
|
|
59
|
-
return
|
|
59
|
+
return _skeletonItem.default;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -19,11 +19,11 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
19
19
|
|
|
20
20
|
var _typography = require("@atlaskit/theme/typography");
|
|
21
21
|
|
|
22
|
-
var _tokens = require("@atlaskit/tokens");
|
|
23
|
-
|
|
24
22
|
/** @jsx jsx */
|
|
25
23
|
var defaultRender = function defaultRender(Component, props) {
|
|
26
|
-
return (
|
|
24
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
25
|
+
(0, _core.jsx)(Component, props)
|
|
26
|
+
);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
var gridSize = (0, _constants.gridSize)();
|
|
@@ -67,7 +67,7 @@ var wordBreakStyles = (0, _core.css)({
|
|
|
67
67
|
});
|
|
68
68
|
var descriptionStyles = (0, _core.css)({
|
|
69
69
|
marginTop: itemDescriptionSpacing,
|
|
70
|
-
color: (
|
|
70
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
71
71
|
fontSize: _typography.headingSizes.h200.size
|
|
72
72
|
});
|
|
73
73
|
var primitiveStyles = (0, _core.css)({
|
|
@@ -100,11 +100,11 @@ var unselectedStyles = (0, _core.css)({
|
|
|
100
100
|
color: 'currentColor'
|
|
101
101
|
},
|
|
102
102
|
':hover': {
|
|
103
|
-
backgroundColor: (
|
|
103
|
+
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"),
|
|
104
104
|
color: 'currentColor'
|
|
105
105
|
},
|
|
106
106
|
':active': {
|
|
107
|
-
backgroundColor: (
|
|
107
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.N30, ")"),
|
|
108
108
|
boxShadow: 'none',
|
|
109
109
|
color: 'currentColor'
|
|
110
110
|
}
|
|
@@ -113,28 +113,23 @@ var disabledStyles = (0, _core.css)({
|
|
|
113
113
|
cursor: 'not-allowed',
|
|
114
114
|
'&, :hover, :active': {
|
|
115
115
|
backgroundColor: 'transparent',
|
|
116
|
-
color: (
|
|
116
|
+
color: "var(--ds-text-disabled, ".concat(_colors.N200, ")")
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
var selectedStyles = (0, _core.css)({
|
|
120
|
-
backgroundColor: (
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
124
|
-
color: (0, _tokens.token)('color.text.selected'),
|
|
120
|
+
backgroundColor: "var(--ds-background-brand, ".concat(_colors.N20, ")"),
|
|
121
|
+
// Fallback set as babel plugin inserts one otherwise
|
|
122
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
125
123
|
':visited': {
|
|
126
|
-
|
|
127
|
-
color: (0, _tokens.token)('color.text.selected')
|
|
124
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
128
125
|
},
|
|
129
126
|
':hover': {
|
|
130
|
-
backgroundColor: (
|
|
131
|
-
|
|
132
|
-
color: (0, _tokens.token)('color.text.selected')
|
|
127
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat(_colors.N20, ")"),
|
|
128
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
133
129
|
},
|
|
134
130
|
':active': {
|
|
135
|
-
backgroundColor: (
|
|
136
|
-
|
|
137
|
-
color: (0, _tokens.token)('color.text.selected')
|
|
131
|
+
backgroundColor: "var(--ds-background-brand-pressed, ".concat(_colors.N30, ")"),
|
|
132
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
138
133
|
}
|
|
139
134
|
});
|
|
140
135
|
/**
|
|
@@ -21,7 +21,7 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
|
|
|
21
21
|
|
|
22
22
|
var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
var _excluded = ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* __Button item__
|
|
@@ -49,7 +49,7 @@ function (props, ref) {
|
|
|
49
49
|
onMouseDown = props.onMouseDown,
|
|
50
50
|
shouldTitleWrap = props.shouldTitleWrap,
|
|
51
51
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
52
|
-
rest = (0, _objectWithoutProperties2.default)(props,
|
|
52
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
53
53
|
var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
|
|
54
54
|
|
|
55
55
|
if (!children) {
|
|
@@ -21,7 +21,8 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
|
|
|
21
21
|
|
|
22
22
|
var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
25
|
+
|
|
25
26
|
var preventEvent = function preventEvent(e) {
|
|
26
27
|
e.preventDefault();
|
|
27
28
|
}; // Dirty hack to get generics working with forward ref [1/2]
|
|
@@ -53,7 +54,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
|
|
|
53
54
|
onMouseDown = _ref.onMouseDown,
|
|
54
55
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
55
56
|
shouldDescriptionWrap = _ref.shouldDescriptionWrap,
|
|
56
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
57
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
58
|
var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
|
|
58
59
|
|
|
59
60
|
if (!Component) {
|
|
@@ -23,16 +23,14 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
23
23
|
|
|
24
24
|
var _typography = require("@atlaskit/theme/typography");
|
|
25
25
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
/** @jsx jsx */
|
|
26
|
+
var _excluded = ["children", "testId", "id", "cssFn"];
|
|
29
27
|
var gridSize = (0, _constants.gridSize)();
|
|
30
28
|
var itemSidePadding = gridSize * 2.5;
|
|
31
29
|
var itemHeadingContentHeight = _typography.headingSizes.h100.lineHeight;
|
|
32
30
|
var itemHeadingFontSize = _typography.headingSizes.h100.size;
|
|
33
31
|
var headingStyles = (0, _core.css)({
|
|
34
32
|
padding: "0 ".concat(itemSidePadding, "px"),
|
|
35
|
-
color: (
|
|
33
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N300, ")"),
|
|
36
34
|
fontSize: itemHeadingFontSize,
|
|
37
35
|
fontWeight: 700,
|
|
38
36
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -53,7 +51,7 @@ var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
53
51
|
id = _ref.id,
|
|
54
52
|
_ref$cssFn = _ref.cssFn,
|
|
55
53
|
cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn,
|
|
56
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
54
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
55
|
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
58
56
|
css: [headingStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
59
57
|
cssFn(undefined)],
|
|
@@ -21,7 +21,8 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
|
|
|
21
21
|
|
|
22
22
|
var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
25
|
+
|
|
25
26
|
var preventEvent = function preventEvent(e) {
|
|
26
27
|
e.preventDefault();
|
|
27
28
|
};
|
|
@@ -54,7 +55,7 @@ function (props, ref) {
|
|
|
54
55
|
onMouseDown = props.onMouseDown,
|
|
55
56
|
shouldTitleWrap = props.shouldTitleWrap,
|
|
56
57
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
57
|
-
rest = (0, _objectWithoutProperties2.default)(props,
|
|
58
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
58
59
|
var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
|
|
59
60
|
|
|
60
61
|
if (!children) {
|
|
@@ -15,8 +15,6 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
18
|
-
var _tokens = require("@atlaskit/tokens");
|
|
19
|
-
|
|
20
18
|
/** @jsx jsx */
|
|
21
19
|
var skeletonStyles = (0, _core.css)({
|
|
22
20
|
padding: "0 ".concat((0, _constants.gridSize)() * 2.5, "px"),
|
|
@@ -24,7 +22,7 @@ var skeletonStyles = (0, _core.css)({
|
|
|
24
22
|
display: 'block',
|
|
25
23
|
width: '30%',
|
|
26
24
|
height: (0, _constants.gridSize)(),
|
|
27
|
-
backgroundColor: (
|
|
25
|
+
backgroundColor: "var(--ds-background-neutral, ".concat((0, _colors.skeleton)(), ")"),
|
|
28
26
|
borderRadius: 100,
|
|
29
27
|
content: '""'
|
|
30
28
|
}
|
|
@@ -15,8 +15,6 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
18
|
-
var _tokens = require("@atlaskit/tokens");
|
|
19
|
-
|
|
20
18
|
/** @jsx jsx */
|
|
21
19
|
var gridSize = (0, _constants.gridSize)();
|
|
22
20
|
var borderRadius = (0, _constants.borderRadius)();
|
|
@@ -28,7 +26,7 @@ var skeletonItemElemSize = gridSize * 2.5;
|
|
|
28
26
|
var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
29
27
|
var skeletonTextBorderRadius = 100;
|
|
30
28
|
var skeletonContentHeight = 9;
|
|
31
|
-
var skeletonColor = (
|
|
29
|
+
var skeletonColor = "var(--ds-background-neutral, ".concat((0, _colors.skeleton)(), ")");
|
|
32
30
|
var skeletonStyles = (0, _core.css)({
|
|
33
31
|
display: 'flex',
|
|
34
32
|
minHeight: itemMinHeight,
|
|
@@ -113,7 +111,7 @@ var SkeletonItem = function SkeletonItem(_ref) {
|
|
|
113
111
|
'--width': width
|
|
114
112
|
},
|
|
115
113
|
css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
116
|
-
cssFn(
|
|
114
|
+
cssFn()],
|
|
117
115
|
"data-testid": testId
|
|
118
116
|
});
|
|
119
117
|
};
|
|
@@ -13,7 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _core = require("@emotion/core");
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"];
|
|
17
17
|
var groupStyles = (0, _core.css)({
|
|
18
18
|
display: 'flex',
|
|
19
19
|
flexDirection: 'column',
|
|
@@ -34,7 +34,7 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
34
34
|
minHeight = _ref.minHeight,
|
|
35
35
|
maxHeight = _ref.maxHeight,
|
|
36
36
|
testId = _ref.testId,
|
|
37
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
37
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
38
|
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
39
39
|
style: {
|
|
40
40
|
minWidth: minWidth,
|
|
@@ -43,7 +43,8 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
43
43
|
maxHeight: maxHeight
|
|
44
44
|
},
|
|
45
45
|
css: groupStyles,
|
|
46
|
-
"data-testid": testId
|
|
46
|
+
"data-testid": testId // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
47
|
+
|
|
47
48
|
}, rest));
|
|
48
49
|
};
|
|
49
50
|
|
|
@@ -15,7 +15,7 @@ var _core = require("@emotion/core");
|
|
|
15
15
|
|
|
16
16
|
var _menuGroup = _interopRequireDefault(require("./menu-group"));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var _excluded = ["maxWidth", "minWidth"];
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @deprecated
|
|
@@ -25,11 +25,13 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
|
|
|
25
25
|
maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
|
|
26
26
|
_ref$minWidth = _ref.minWidth,
|
|
27
27
|
minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
|
|
28
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
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;
|
|
@@ -21,11 +21,9 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
21
21
|
|
|
22
22
|
var _typography = require("@atlaskit/theme/typography");
|
|
23
23
|
|
|
24
|
-
var _tokens = require("@atlaskit/tokens");
|
|
25
|
-
|
|
26
24
|
var _headingItem = _interopRequireDefault(require("../menu-item/heading-item"));
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"];
|
|
29
27
|
var gridSize = (0, _constants.gridSize)();
|
|
30
28
|
var itemHeadingTopMargin = gridSize * 2.5;
|
|
31
29
|
var itemHeadingBottomMargin = gridSize * 0.75; // Skeleton content is slightly shorter than the real content.
|
|
@@ -78,7 +76,7 @@ var unscrollableStyles = (0, _core.css)({
|
|
|
78
76
|
flexShrink: 0
|
|
79
77
|
});
|
|
80
78
|
var separatorStyles = (0, _core.css)({
|
|
81
|
-
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat((
|
|
79
|
+
borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border, ".concat(_colors.N30A, ")"), ")")
|
|
82
80
|
});
|
|
83
81
|
var noSeparatorStyles = (0, _core.css)({
|
|
84
82
|
// this is to ensure that adjacent sections without separators don't get additional margins.
|
|
@@ -104,7 +102,7 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
104
102
|
isScrollable = _ref.isScrollable,
|
|
105
103
|
hasSeparator = _ref.hasSeparator,
|
|
106
104
|
id = _ref.id,
|
|
107
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
105
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
108
106
|
var childrenMarkup = title !== undefined ? (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)(_headingItem.default // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
109
107
|
, {
|
|
110
108
|
cssFn: overrides && overrides.HeadingItem && overrides.HeadingItem.cssFn,
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,9 +5,9 @@ import FocusRing from '@atlaskit/focus-ring';
|
|
|
5
5
|
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
|
-
import { token } from '@atlaskit/tokens';
|
|
9
8
|
|
|
10
|
-
const defaultRender = (Component, props) =>
|
|
9
|
+
const defaultRender = (Component, props) => // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
10
|
+
jsx(Component, props);
|
|
11
11
|
|
|
12
12
|
const gridSize = gridSizeFn();
|
|
13
13
|
const fontSize = fontSizeFn();
|
|
@@ -50,7 +50,7 @@ const wordBreakStyles = css({
|
|
|
50
50
|
});
|
|
51
51
|
const descriptionStyles = css({
|
|
52
52
|
marginTop: itemDescriptionSpacing,
|
|
53
|
-
color:
|
|
53
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
54
54
|
fontSize: headingSizes.h200.size
|
|
55
55
|
});
|
|
56
56
|
const primitiveStyles = css({
|
|
@@ -83,11 +83,11 @@ const unselectedStyles = css({
|
|
|
83
83
|
color: 'currentColor'
|
|
84
84
|
},
|
|
85
85
|
':hover': {
|
|
86
|
-
backgroundColor:
|
|
86
|
+
backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N20})`,
|
|
87
87
|
color: 'currentColor'
|
|
88
88
|
},
|
|
89
89
|
':active': {
|
|
90
|
-
backgroundColor:
|
|
90
|
+
backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${N30})`,
|
|
91
91
|
boxShadow: 'none',
|
|
92
92
|
color: 'currentColor'
|
|
93
93
|
}
|
|
@@ -96,28 +96,23 @@ const disabledStyles = css({
|
|
|
96
96
|
cursor: 'not-allowed',
|
|
97
97
|
'&, :hover, :active': {
|
|
98
98
|
backgroundColor: 'transparent',
|
|
99
|
-
color:
|
|
99
|
+
color: `var(--ds-text-disabled, ${N200})`
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
const selectedStyles = css({
|
|
103
|
-
backgroundColor:
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
107
|
-
color: token('color.text.selected'),
|
|
103
|
+
backgroundColor: `var(--ds-background-brand, ${N20})`,
|
|
104
|
+
// Fallback set as babel plugin inserts one otherwise
|
|
105
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
108
106
|
':visited': {
|
|
109
|
-
|
|
110
|
-
color: token('color.text.selected')
|
|
107
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
111
108
|
},
|
|
112
109
|
':hover': {
|
|
113
|
-
backgroundColor:
|
|
114
|
-
|
|
115
|
-
color: token('color.text.selected')
|
|
110
|
+
backgroundColor: `var(--ds-background-brand-hovered, ${N20})`,
|
|
111
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
116
112
|
},
|
|
117
113
|
':active': {
|
|
118
|
-
backgroundColor:
|
|
119
|
-
|
|
120
|
-
color: token('color.text.selected')
|
|
114
|
+
backgroundColor: `var(--ds-background-brand-pressed, ${N30})`,
|
|
115
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
121
116
|
}
|
|
122
117
|
});
|
|
123
118
|
/**
|
|
@@ -4,17 +4,16 @@ 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
|
-
import { token } from '@atlaskit/tokens';
|
|
11
10
|
const gridSize = gridSizeFn();
|
|
12
11
|
const itemSidePadding = gridSize * 2.5;
|
|
13
12
|
const itemHeadingContentHeight = headingSizes.h100.lineHeight;
|
|
14
13
|
const itemHeadingFontSize = headingSizes.h100.size;
|
|
15
14
|
const headingStyles = css({
|
|
16
15
|
padding: `0 ${itemSidePadding}px`,
|
|
17
|
-
color:
|
|
16
|
+
color: `var(--ds-text-subtle, ${N300})`,
|
|
18
17
|
fontSize: itemHeadingFontSize,
|
|
19
18
|
fontWeight: 700,
|
|
20
19
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -3,14 +3,13 @@ import { css, jsx } from '@emotion/core';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
|
|
5
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
const skeletonStyles = css({
|
|
8
7
|
padding: `0 ${gridSize() * 2.5}px`,
|
|
9
8
|
'::after': {
|
|
10
9
|
display: 'block',
|
|
11
10
|
width: '30%',
|
|
12
11
|
height: gridSize(),
|
|
13
|
-
backgroundColor:
|
|
12
|
+
backgroundColor: `var(--ds-background-neutral, ${skeletonColorFn()})`,
|
|
14
13
|
borderRadius: 100,
|
|
15
14
|
content: '""'
|
|
16
15
|
}
|
|
@@ -3,7 +3,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
|
|
5
5
|
import { borderRadius as borderRadiusFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
const gridSize = gridSizeFn();
|
|
8
7
|
const borderRadius = borderRadiusFn();
|
|
9
8
|
const itemElemSpacing = gridSize * 1.5;
|
|
@@ -14,7 +13,7 @@ const skeletonItemElemSize = gridSize * 2.5;
|
|
|
14
13
|
const itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
15
14
|
const skeletonTextBorderRadius = 100;
|
|
16
15
|
const skeletonContentHeight = 9;
|
|
17
|
-
const skeletonColor =
|
|
16
|
+
const skeletonColor = `var(--ds-background-neutral, ${skeletonColorFn()})`;
|
|
18
17
|
const skeletonStyles = css({
|
|
19
18
|
display: 'flex',
|
|
20
19
|
minHeight: itemMinHeight,
|
|
@@ -98,7 +97,7 @@ const SkeletonItem = ({
|
|
|
98
97
|
'--width': width
|
|
99
98
|
},
|
|
100
99
|
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(
|
|
100
|
+
cssFn()],
|
|
102
101
|
"data-testid": testId
|
|
103
102
|
});
|
|
104
103
|
|
|
@@ -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));
|
|
@@ -6,7 +6,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
6
6
|
import { N30A } from '@atlaskit/theme/colors';
|
|
7
7
|
import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
8
8
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
9
|
import HeadingItem from '../menu-item/heading-item';
|
|
11
10
|
const gridSize = gridSizeFn();
|
|
12
11
|
const itemHeadingTopMargin = gridSize * 2.5;
|
|
@@ -60,7 +59,7 @@ const unscrollableStyles = css({
|
|
|
60
59
|
flexShrink: 0
|
|
61
60
|
});
|
|
62
61
|
const separatorStyles = css({
|
|
63
|
-
borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${
|
|
62
|
+
borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border, ${N30A})`})`
|
|
64
63
|
});
|
|
65
64
|
const noSeparatorStyles = css({
|
|
66
65
|
// this is to ensure that adjacent sections without separators don't get additional margins.
|
package/dist/es2019/version.json
CHANGED
|
@@ -5,10 +5,11 @@ import FocusRing from '@atlaskit/focus-ring';
|
|
|
5
5
|
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
|
-
import { token } from '@atlaskit/tokens';
|
|
9
8
|
|
|
10
9
|
var defaultRender = function defaultRender(Component, props) {
|
|
11
|
-
return
|
|
10
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
11
|
+
jsx(Component, props)
|
|
12
|
+
);
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
var gridSize = gridSizeFn();
|
|
@@ -52,7 +53,7 @@ var wordBreakStyles = css({
|
|
|
52
53
|
});
|
|
53
54
|
var descriptionStyles = css({
|
|
54
55
|
marginTop: itemDescriptionSpacing,
|
|
55
|
-
color:
|
|
56
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
56
57
|
fontSize: headingSizes.h200.size
|
|
57
58
|
});
|
|
58
59
|
var primitiveStyles = css({
|
|
@@ -85,11 +86,11 @@ var unselectedStyles = css({
|
|
|
85
86
|
color: 'currentColor'
|
|
86
87
|
},
|
|
87
88
|
':hover': {
|
|
88
|
-
backgroundColor:
|
|
89
|
+
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"),
|
|
89
90
|
color: 'currentColor'
|
|
90
91
|
},
|
|
91
92
|
':active': {
|
|
92
|
-
backgroundColor:
|
|
93
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(N30, ")"),
|
|
93
94
|
boxShadow: 'none',
|
|
94
95
|
color: 'currentColor'
|
|
95
96
|
}
|
|
@@ -98,28 +99,23 @@ var disabledStyles = css({
|
|
|
98
99
|
cursor: 'not-allowed',
|
|
99
100
|
'&, :hover, :active': {
|
|
100
101
|
backgroundColor: 'transparent',
|
|
101
|
-
color:
|
|
102
|
+
color: "var(--ds-text-disabled, ".concat(N200, ")")
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
105
|
var selectedStyles = css({
|
|
105
|
-
backgroundColor:
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
109
|
-
color: token('color.text.selected'),
|
|
106
|
+
backgroundColor: "var(--ds-background-brand, ".concat(N20, ")"),
|
|
107
|
+
// Fallback set as babel plugin inserts one otherwise
|
|
108
|
+
color: "var(--ds-text-brand, currentColor)",
|
|
110
109
|
':visited': {
|
|
111
|
-
|
|
112
|
-
color: token('color.text.selected')
|
|
110
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
113
111
|
},
|
|
114
112
|
':hover': {
|
|
115
|
-
backgroundColor:
|
|
116
|
-
|
|
117
|
-
color: token('color.text.selected')
|
|
113
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat(N20, ")"),
|
|
114
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
118
115
|
},
|
|
119
116
|
':active': {
|
|
120
|
-
backgroundColor:
|
|
121
|
-
|
|
122
|
-
color: token('color.text.selected')
|
|
117
|
+
backgroundColor: "var(--ds-background-brand-pressed, ".concat(N30, ")"),
|
|
118
|
+
color: "var(--ds-text-brand, currentColor)"
|
|
123
119
|
}
|
|
124
120
|
});
|
|
125
121
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { forwardRef, memo } from 'react';
|
|
@@ -34,7 +35,7 @@ function (props, ref) {
|
|
|
34
35
|
onMouseDown = props.onMouseDown,
|
|
35
36
|
shouldTitleWrap = props.shouldTitleWrap,
|
|
36
37
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
37
|
-
rest = _objectWithoutProperties(props,
|
|
38
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
38
39
|
|
|
39
40
|
var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
|
|
40
41
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { forwardRef, memo } from 'react';
|
|
@@ -39,7 +40,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
39
40
|
onMouseDown = _ref.onMouseDown,
|
|
40
41
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
41
42
|
shouldDescriptionWrap = _ref.shouldDescriptionWrap,
|
|
42
|
-
rest = _objectWithoutProperties(_ref,
|
|
43
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
44
|
|
|
44
45
|
var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
|
|
45
46
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "testId", "id", "cssFn"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { memo } from 'react';
|
|
6
7
|
import { css, jsx } from '@emotion/core';
|
|
7
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
8
|
-
import {
|
|
9
|
+
import { N300 } from '@atlaskit/theme/colors';
|
|
9
10
|
import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
10
11
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
11
|
-
import { token } from '@atlaskit/tokens';
|
|
12
12
|
var gridSize = gridSizeFn();
|
|
13
13
|
var itemSidePadding = gridSize * 2.5;
|
|
14
14
|
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:
|
|
18
|
+
color: "var(--ds-text-subtle, ".concat(N300, ")"),
|
|
19
19
|
fontSize: itemHeadingFontSize,
|
|
20
20
|
fontWeight: 700,
|
|
21
21
|
lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
|
|
@@ -36,7 +36,7 @@ var HeadingItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
36
|
id = _ref.id,
|
|
37
37
|
_ref$cssFn = _ref.cssFn,
|
|
38
38
|
cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn,
|
|
39
|
-
rest = _objectWithoutProperties(_ref,
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
|
|
41
41
|
return jsx("div", _extends({
|
|
42
42
|
css: [headingStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { forwardRef, memo } from 'react';
|
|
@@ -40,7 +41,7 @@ function (props, ref) {
|
|
|
40
41
|
onMouseDown = props.onMouseDown,
|
|
41
42
|
shouldTitleWrap = props.shouldTitleWrap,
|
|
42
43
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
43
|
-
rest = _objectWithoutProperties(props,
|
|
44
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
44
45
|
|
|
45
46
|
var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
|
|
46
47
|
|
|
@@ -3,14 +3,13 @@ import { css, jsx } from '@emotion/core';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
|
|
5
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
var skeletonStyles = css({
|
|
8
7
|
padding: "0 ".concat(gridSize() * 2.5, "px"),
|
|
9
8
|
'::after': {
|
|
10
9
|
display: 'block',
|
|
11
10
|
width: '30%',
|
|
12
11
|
height: gridSize(),
|
|
13
|
-
backgroundColor:
|
|
12
|
+
backgroundColor: "var(--ds-background-neutral, ".concat(skeletonColorFn(), ")"),
|
|
14
13
|
borderRadius: 100,
|
|
15
14
|
content: '""'
|
|
16
15
|
}
|
|
@@ -3,7 +3,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
|
|
5
5
|
import { borderRadius as borderRadiusFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
var gridSize = gridSizeFn();
|
|
8
7
|
var borderRadius = borderRadiusFn();
|
|
9
8
|
var itemElemSpacing = gridSize * 1.5;
|
|
@@ -14,7 +13,7 @@ var skeletonItemElemSize = gridSize * 2.5;
|
|
|
14
13
|
var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
|
|
15
14
|
var skeletonTextBorderRadius = 100;
|
|
16
15
|
var skeletonContentHeight = 9;
|
|
17
|
-
var skeletonColor =
|
|
16
|
+
var skeletonColor = "var(--ds-background-neutral, ".concat(skeletonColorFn(), ")");
|
|
18
17
|
var skeletonStyles = css({
|
|
19
18
|
display: 'flex',
|
|
20
19
|
minHeight: itemMinHeight,
|
|
@@ -99,7 +98,7 @@ var SkeletonItem = function SkeletonItem(_ref) {
|
|
|
99
98
|
'--width': width
|
|
100
99
|
},
|
|
101
100
|
css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
102
|
-
cssFn(
|
|
101
|
+
cssFn()],
|
|
103
102
|
"data-testid": testId
|
|
104
103
|
});
|
|
105
104
|
};
|
|
@@ -1,5 +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
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { css, jsx } from '@emotion/core';
|
|
@@ -23,7 +24,7 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
23
24
|
minHeight = _ref.minHeight,
|
|
24
25
|
maxHeight = _ref.maxHeight,
|
|
25
26
|
testId = _ref.testId,
|
|
26
|
-
rest = _objectWithoutProperties(_ref,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
|
|
28
29
|
return jsx("div", _extends({
|
|
29
30
|
style: {
|
|
@@ -33,7 +34,8 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
33
34
|
maxHeight: maxHeight
|
|
34
35
|
},
|
|
35
36
|
css: groupStyles,
|
|
36
|
-
"data-testid": testId
|
|
37
|
+
"data-testid": testId // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
38
|
+
|
|
37
39
|
}, rest));
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -1,5 +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"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { jsx } from '@emotion/core';
|
|
@@ -13,12 +14,14 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
|
|
|
13
14
|
maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
|
|
14
15
|
_ref$minWidth = _ref.minWidth,
|
|
15
16
|
minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
|
|
16
|
-
rest = _objectWithoutProperties(_ref,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
18
|
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
);
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export default PopupMenuGroup;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"];
|
|
3
4
|
|
|
4
5
|
/** @jsx jsx */
|
|
5
6
|
import { forwardRef, Fragment } from 'react';
|
|
@@ -7,7 +8,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
7
8
|
import { N30A } from '@atlaskit/theme/colors';
|
|
8
9
|
import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
|
|
9
10
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
10
|
-
import { token } from '@atlaskit/tokens';
|
|
11
11
|
import HeadingItem from '../menu-item/heading-item';
|
|
12
12
|
var gridSize = gridSizeFn();
|
|
13
13
|
var itemHeadingTopMargin = gridSize * 2.5;
|
|
@@ -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(
|
|
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.
|
|
@@ -87,7 +87,7 @@ var Section = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
87
87
|
isScrollable = _ref.isScrollable,
|
|
88
88
|
hasSeparator = _ref.hasSeparator,
|
|
89
89
|
id = _ref.id,
|
|
90
|
-
rest = _objectWithoutProperties(_ref,
|
|
90
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
91
91
|
|
|
92
92
|
var childrenMarkup = title !== undefined ? jsx(Fragment, null, jsx(HeadingItem // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
93
93
|
, {
|
package/dist/esm/version.json
CHANGED
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
|
}
|
|
@@ -78,6 +84,9 @@ export interface SectionProps {
|
|
|
78
84
|
* serving as a hook for automated tests.
|
|
79
85
|
*/
|
|
80
86
|
testId?: string;
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
89
|
+
*/
|
|
81
90
|
overrides?: {
|
|
82
91
|
HeadingItem?: {
|
|
83
92
|
/**
|
|
@@ -102,6 +111,9 @@ export interface MenuItemPrimitiveProps {
|
|
|
102
111
|
description: React.ReactNode | undefined;
|
|
103
112
|
iconAfter: React.ReactNode | undefined;
|
|
104
113
|
iconBefore: React.ReactNode | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
116
|
+
*/
|
|
105
117
|
overrides: Overrides | undefined;
|
|
106
118
|
shouldTitleWrap: boolean | undefined;
|
|
107
119
|
shouldDescriptionWrap: boolean | undefined;
|
|
@@ -113,6 +125,8 @@ export interface MenuItemProps {
|
|
|
113
125
|
/**
|
|
114
126
|
* A function that can be used to override the styles of the component.
|
|
115
127
|
* It receives the current styles and state and expects a styles object.
|
|
128
|
+
*
|
|
129
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
116
130
|
*/
|
|
117
131
|
cssFn?: CSSFn;
|
|
118
132
|
/**
|
|
@@ -158,6 +172,8 @@ export interface MenuItemProps {
|
|
|
158
172
|
testId?: string;
|
|
159
173
|
/**
|
|
160
174
|
* Custom overrides for the composed components.
|
|
175
|
+
*
|
|
176
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
161
177
|
*/
|
|
162
178
|
overrides?: Overrides;
|
|
163
179
|
/**
|
|
@@ -294,6 +310,8 @@ export interface HeadingItemProps {
|
|
|
294
310
|
/**
|
|
295
311
|
* A function that can be used to override the styles.
|
|
296
312
|
* It receives the current styles and returns a customised styles object.
|
|
313
|
+
*
|
|
314
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
297
315
|
*/
|
|
298
316
|
cssFn?: StatelessCSSFn;
|
|
299
317
|
/**
|
|
@@ -333,6 +351,8 @@ export interface SkeletonHeadingItemProps {
|
|
|
333
351
|
/**
|
|
334
352
|
* A function that can be used to override the styles of this component.
|
|
335
353
|
* It receives the current styles and returns a customized styles object.
|
|
354
|
+
*
|
|
355
|
+
* @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
336
356
|
*/
|
|
337
357
|
cssFn?: StatelessCSSFn;
|
|
338
358
|
}
|
|
@@ -346,8 +366,12 @@ export declare type ItemState = {
|
|
|
346
366
|
* and should return a CSSObject.
|
|
347
367
|
*
|
|
348
368
|
* @see @atlaskit/menu/docs/85-overriding-item-styles
|
|
369
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
349
370
|
*/
|
|
350
|
-
export interface CSSFn<TState = ItemState> {
|
|
371
|
+
export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
|
|
351
372
|
(currentState: TState): CSSObject | CSSObject[];
|
|
352
373
|
}
|
|
353
|
-
|
|
374
|
+
/**
|
|
375
|
+
* @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
|
|
376
|
+
*/
|
|
377
|
+
export declare type StatelessCSSFn = CSSFn<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/menu",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "A collection of composable menu components that can be used anywhere.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"inPublicMirror": true,
|
|
20
19
|
"releaseModel": "scheduled",
|
|
21
20
|
"website": {
|
|
22
21
|
"name": "Menu"
|
|
@@ -36,10 +35,10 @@
|
|
|
36
35
|
".": "./src/index.tsx"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@atlaskit/ds-lib": "^1.
|
|
40
|
-
"@atlaskit/focus-ring": "^0.
|
|
41
|
-
"@atlaskit/theme": "^12.
|
|
42
|
-
"@atlaskit/tokens": "^0.
|
|
38
|
+
"@atlaskit/ds-lib": "^1.4.0",
|
|
39
|
+
"@atlaskit/focus-ring": "^1.0.0",
|
|
40
|
+
"@atlaskit/theme": "^12.1.0",
|
|
41
|
+
"@atlaskit/tokens": "^0.6.0",
|
|
43
42
|
"@babel/runtime": "^7.0.0",
|
|
44
43
|
"@emotion/core": "^10.0.9"
|
|
45
44
|
},
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"@atlaskit/avatar": "^20.5.0",
|
|
52
51
|
"@atlaskit/button": "^16.0.0",
|
|
53
52
|
"@atlaskit/docs": "*",
|
|
54
|
-
"@atlaskit/icon": "^21.
|
|
53
|
+
"@atlaskit/icon": "^21.10.0",
|
|
55
54
|
"@atlaskit/icon-file-type": "^6.0.0",
|
|
56
55
|
"@atlaskit/icon-object": "^6.0.0",
|
|
57
56
|
"@atlaskit/section-message": "^6.0.0",
|
|
@@ -81,7 +80,10 @@
|
|
|
81
80
|
"@repo/internal": {
|
|
82
81
|
"ui-components": "lite-mode",
|
|
83
82
|
"design-system": "v1",
|
|
84
|
-
"styling":
|
|
83
|
+
"styling": [
|
|
84
|
+
"static",
|
|
85
|
+
"emotion"
|
|
86
|
+
],
|
|
85
87
|
"analytics": "analytics-next",
|
|
86
88
|
"theming": "tokens",
|
|
87
89
|
"deprecation": "no-deprecated-imports"
|