@atlaskit/menu 1.2.5 → 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 +10 -0
- package/dist/cjs/internal/components/menu-item-primitive.js +3 -1
- package/dist/cjs/menu-item/heading-item.js +1 -1
- package/dist/cjs/menu-item/skeleton-item.js +1 -1
- package/dist/cjs/menu-section/menu-group.js +2 -1
- package/dist/cjs/menu-section/popup-menu-group.js +6 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/components/menu-item-primitive.js +2 -1
- package/dist/es2019/menu-item/heading-item.js +2 -2
- package/dist/es2019/menu-item/skeleton-item.js +1 -1
- package/dist/es2019/menu-section/menu-group.js +2 -1
- package/dist/es2019/menu-section/popup-menu-group.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/components/menu-item-primitive.js +3 -1
- package/dist/esm/menu-item/heading-item.js +2 -2
- package/dist/esm/menu-item/skeleton-item.js +1 -1
- package/dist/esm/menu-section/menu-group.js +2 -1
- package/dist/esm/menu-section/popup-menu-group.js +6 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +26 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
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
|
+
|
|
3
13
|
## 1.2.5
|
|
4
14
|
|
|
5
15
|
### 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)();
|
|
@@ -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,
|
|
@@ -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
|
};
|
|
@@ -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;
|
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();
|
|
@@ -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,
|
|
@@ -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
|
|
|
@@ -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));
|
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();
|
|
@@ -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,
|
|
@@ -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
|
};
|
|
@@ -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;
|
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/"
|
|
@@ -35,8 +35,8 @@
|
|
|
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
41
|
"@atlaskit/tokens": "^0.6.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|