@atlaskit/menu 5.0.1 → 7.0.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 +29 -0
- package/dist/cjs/menu-item/heading-item.compiled.css +4 -0
- package/dist/cjs/menu-item/heading-item.js +17 -29
- package/dist/cjs/menu-section/menu-group.compiled.css +5 -0
- package/dist/cjs/menu-section/menu-group.js +12 -17
- package/dist/cjs/menu-section/popup-menu-group.js +9 -8
- package/dist/cjs/menu-section/section.compiled.css +17 -0
- package/dist/cjs/menu-section/section.js +34 -88
- package/dist/es2019/menu-item/heading-item.compiled.css +4 -0
- package/dist/es2019/menu-item/heading-item.js +7 -26
- package/dist/es2019/menu-section/menu-group.compiled.css +5 -0
- package/dist/es2019/menu-section/menu-group.js +9 -17
- package/dist/es2019/menu-section/popup-menu-group.js +6 -6
- package/dist/es2019/menu-section/section.compiled.css +17 -0
- package/dist/es2019/menu-section/section.js +28 -87
- package/dist/esm/menu-item/heading-item.compiled.css +4 -0
- package/dist/esm/menu-item/heading-item.js +13 -29
- package/dist/esm/menu-section/menu-group.compiled.css +5 -0
- package/dist/esm/menu-section/menu-group.js +9 -17
- package/dist/esm/menu-section/popup-menu-group.js +6 -6
- package/dist/esm/menu-section/section.compiled.css +17 -0
- package/dist/esm/menu-section/section.js +30 -88
- package/dist/types/index.d.ts +1 -1
- package/dist/types/menu-item/heading-item.d.ts +1 -2
- package/dist/types/menu-section/menu-group.d.ts +2 -6
- package/dist/types/menu-section/popup-menu-group.d.ts +2 -6
- package/dist/types/types.d.ts +6 -36
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/menu-item/heading-item.d.ts +1 -2
- package/dist/types-ts4.5/menu-section/menu-group.d.ts +2 -6
- package/dist/types-ts4.5/menu-section/popup-menu-group.d.ts +2 -6
- package/dist/types-ts4.5/types.d.ts +6 -36
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#156707](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/156707)
|
|
8
|
+
[`84d702274b2dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/84d702274b2dd) -
|
|
9
|
+
Migrated `HeadingItem` and `Section` components from @emotion/react to @compiled/react in order to
|
|
10
|
+
improve performance, align with the rest of the Atlaskit techstack, and support React 18 Streaming
|
|
11
|
+
SSR.
|
|
12
|
+
|
|
13
|
+
Removed the deprecated `cssFn` prop from the `HeadingItem` component, as this is not supported
|
|
14
|
+
with @compiled/react.
|
|
15
|
+
|
|
16
|
+
## 6.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- [#148607](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148607)
|
|
21
|
+
[`474e66c7b2f54`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/474e66c7b2f54) -
|
|
22
|
+
Removed deprecated `overrides` prop from Section. Introduced `isSideNavSection` prop on Section
|
|
23
|
+
which when true renders headings with reduced padding. This prop was added exclusively to support
|
|
24
|
+
existing functionality in `@atlaskit/side-navigation` and will be removed once the new navigation
|
|
25
|
+
system fully rolls out. It should not be used outside of the Side Navigation component. Removed
|
|
26
|
+
deprecated `Overrides` and `TitleOverrides` types.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 5.0.1
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
3
|
+
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
4
|
+
._syaz1vvm{color:var(--_bbz764)}
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
+
/* heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./heading-item.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
12
|
-
var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
|
|
13
|
-
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
14
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
|
-
var _excluded = ["children", "testId", "headingLevel", "id", "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
|
-
var headingStyles = (0, _react2.css)({
|
|
22
|
-
color: "var(--ds-text-subtle, ".concat(_colors.N300, ")"),
|
|
23
|
-
font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
24
|
-
paddingBlock: "var(--ds-space-0, 0px)",
|
|
25
|
-
paddingInline: "var(--ds-space-200, 16px)"
|
|
26
|
-
});
|
|
17
|
+
var _excluded = ["children", "testId", "headingLevel", "id", "className"];
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
var headingStyles = null;
|
|
27
21
|
|
|
28
22
|
/**
|
|
29
23
|
* __Heading item__
|
|
@@ -39,19 +33,9 @@ var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
39
33
|
_ref$headingLevel = _ref.headingLevel,
|
|
40
34
|
headingLevel = _ref$headingLevel === void 0 ? 2 : _ref$headingLevel,
|
|
41
35
|
id = _ref.id,
|
|
42
|
-
_ref$cssFn = _ref.cssFn,
|
|
43
|
-
cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn,
|
|
44
36
|
UNSAFE_className = _ref.className,
|
|
45
37
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
50
|
-
var UNSAFE_overrides = (0, _react2.css)(cssFn(undefined));
|
|
51
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
52
|
-
css: [headingStyles,
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
54
|
-
UNSAFE_overrides],
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
55
39
|
role: "heading",
|
|
56
40
|
"aria-level": headingLevel,
|
|
57
41
|
"data-testid": testId,
|
|
@@ -59,7 +43,11 @@ var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
59
43
|
id: id
|
|
60
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
61
45
|
,
|
|
62
|
-
className: UNSAFE_className
|
|
63
|
-
}, rest
|
|
46
|
+
className: (0, _runtime.ax)(["_11c81vhk _1rjcze3t _18zrpxbi _syaz1vvm", UNSAFE_className])
|
|
47
|
+
}, rest, {
|
|
48
|
+
style: {
|
|
49
|
+
"--_bbz764": (0, _runtime.ix)("var(--ds-text-subtle, ".concat(_colors.N300, ")"))
|
|
50
|
+
}
|
|
51
|
+
}), children);
|
|
64
52
|
});
|
|
65
53
|
var _default = exports.default = HeadingItem;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
+
/* menu-group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./menu-group.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("@emotion/react");
|
|
11
15
|
var _menuContext = require("../internal/components/menu-context");
|
|
12
16
|
var _excluded = ["isLoading", "maxWidth", "minWidth", "minHeight", "maxHeight", "testId", "role", "spacing", "className"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
-
var baseStyles = (0, _react.css)({
|
|
19
|
-
display: 'flex',
|
|
20
|
-
position: 'static',
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
overflow: 'auto'
|
|
23
|
-
});
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
var baseStyles = null;
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* __Menu group__
|
|
@@ -42,11 +38,11 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
42
38
|
spacing = _ref$spacing === void 0 ? 'cozy' : _ref$spacing,
|
|
43
39
|
UNSAFE_className = _ref.className,
|
|
44
40
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
45
|
-
return
|
|
41
|
+
return /*#__PURE__*/React.createElement(_menuContext.SpacingContext.Provider, {
|
|
46
42
|
value: spacing
|
|
47
|
-
},
|
|
43
|
+
}, /*#__PURE__*/React.createElement(_menuContext.SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
48
44
|
value: "border"
|
|
49
|
-
},
|
|
45
|
+
}, /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
50
46
|
"aria-busy": isLoading,
|
|
51
47
|
style: {
|
|
52
48
|
minWidth: minWidth,
|
|
@@ -54,12 +50,11 @@ var MenuGroup = function MenuGroup(_ref) {
|
|
|
54
50
|
minHeight: minHeight,
|
|
55
51
|
maxHeight: maxHeight
|
|
56
52
|
},
|
|
57
|
-
css: baseStyles,
|
|
58
53
|
"data-testid": testId,
|
|
59
54
|
role: role
|
|
60
55
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
61
56
|
,
|
|
62
|
-
className: UNSAFE_className
|
|
57
|
+
className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1e0c1txw _kqswpfqs _2lx21bp4", UNSAFE_className])
|
|
63
58
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
64
59
|
}, rest))));
|
|
65
60
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
/* popup-menu-group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("@emotion/react");
|
|
11
14
|
var _menuGroup = _interopRequireDefault(require("./menu-group"));
|
|
12
|
-
var _excluded = ["maxWidth", "minWidth"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @jsx jsx
|
|
16
|
-
*/
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
+
var _excluded = ["maxWidth", "minWidth"]; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
/**
|
|
19
19
|
* @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
|
|
20
20
|
*/
|
|
@@ -25,8 +25,9 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
|
|
|
25
25
|
minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
|
|
26
26
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
27
|
return (
|
|
28
|
+
/*#__PURE__*/
|
|
28
29
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
29
|
-
|
|
30
|
+
React.createElement(_menuGroup.default, (0, _extends2.default)({
|
|
30
31
|
maxWidth: maxWidth,
|
|
31
32
|
minWidth: minWidth
|
|
32
33
|
}, rest))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._18zru2gc{padding-inline:var(--ds-space-100,8px)}
|
|
3
|
+
._mqm21imm{border-block-start:1px solid var(--ds-menu-seperator-color,var(--ds-border,rgba(9,30,66,.08)))}._18m91wug{overflow-y:auto}
|
|
4
|
+
._1l6bgktf [data-ds--menu--heading-item]{margin-block-start:20px}
|
|
5
|
+
._1mfv8jkm [data-ds--menu--skeleton-heading-item]:first-of-type{margin-block-start:19px}
|
|
6
|
+
._1o9zidpf{flex-shrink:0}
|
|
7
|
+
._1o9zkb7n{flex-shrink:1}
|
|
8
|
+
._1p3hi2wt [data-ds--menu--heading-item]{margin-block-end:6px}
|
|
9
|
+
._1qdgi2wt:after, ._kfgti2wt:before{height:6px}
|
|
10
|
+
._1reo1wug{overflow-x:auto}
|
|
11
|
+
._1ywu1ule:after, ._cfu11ule:before{display:block}
|
|
12
|
+
._aetrb3bt:after, ._1kt9b3bt:before{content:""}
|
|
13
|
+
._auo4rdoj [data-ds--menu--skeleton-heading-item]{margin-block-end:9px}
|
|
14
|
+
._hp2110yn [data-ds--menu--skeleton-heading-item]{margin-block-start:25px}
|
|
15
|
+
._osbldlk8 [data-ds--menu--heading-item]:first-of-type{margin-block-start:14px}
|
|
16
|
+
[data-section]+._n7cnyjp0{margin-block-start:-6px}
|
|
17
|
+
._1bg41n1a:focus{outline-offset:-1px}
|
|
@@ -1,93 +1,40 @@
|
|
|
1
|
+
/* section.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./section.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
12
|
-
var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
|
|
13
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
14
16
|
var _headingItem = _interopRequireDefault(require("../menu-item/heading-item"));
|
|
15
|
-
var _excluded = ["children", "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
|
-
var gridSize = 8;
|
|
22
|
-
var itemHeadingTopMargin = gridSize * 2.5;
|
|
23
|
-
var itemHeadingBottomMargin = gridSize * 0.75;
|
|
17
|
+
var _excluded = ["children", "title", "titleId", "testId", "isScrollable", "hasSeparator", "id", "isList", "isSideNavSection", "className"];
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
var itemHeadingTopMargin = 20;
|
|
21
|
+
var itemHeadingBottomMargin = 6;
|
|
24
22
|
// Skeleton content is slightly shorter than the real content.
|
|
25
23
|
// Because of that we slightly increase the top margin to offset this so the
|
|
26
24
|
// containing size both real and skeleton always equal approx 30px.
|
|
27
25
|
var itemHeadingContentHeight = 16; // Originally headingSizes.h100.lineHeight from '@atlaskit/theme/typography'
|
|
28
|
-
var skeletonHeadingHeight =
|
|
26
|
+
var skeletonHeadingHeight = 8;
|
|
29
27
|
var skeletonHeadingMarginOffset = 3;
|
|
30
28
|
var skeletonHeadingTopMargin = itemHeadingTopMargin + (itemHeadingContentHeight - skeletonHeadingHeight) - skeletonHeadingMarginOffset;
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
content: '""'
|
|
41
|
-
},
|
|
42
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
43
|
-
'& [data-ds--menu--heading-item]': {
|
|
44
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
45
|
-
marginBlockEnd: itemHeadingBottomMargin,
|
|
46
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
47
|
-
marginBlockStart: itemHeadingTopMargin,
|
|
48
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
49
|
-
'&:first-of-type': {
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
51
|
-
marginBlockStart: itemHeadingTopMargin - sectionPaddingTopBottom
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
55
|
-
'& [data-ds--menu--skeleton-heading-item]': {
|
|
56
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
57
|
-
marginBlockEnd: skeletonHeadingBottomMargin,
|
|
58
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
|
-
marginBlockStart: skeletonHeadingTopMargin,
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
61
|
-
'&:first-of-type': {
|
|
62
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
63
|
-
marginBlockStart: skeletonHeadingTopMargin - sectionPaddingTopBottom
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
'&:focus': {
|
|
67
|
-
// NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
|
|
68
|
-
// We have made a deliberate choice to leave this behaviour as is.
|
|
69
|
-
// This makes the outline go inside by 1px so it can actually be displayed
|
|
70
|
-
// else it gets cut off from the overflow: scroll from the parent menu group.
|
|
71
|
-
outlineOffset: -1
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
var scrollableStyles = (0, _react2.css)({
|
|
75
|
-
flexShrink: 1,
|
|
76
|
-
overflow: 'auto'
|
|
77
|
-
});
|
|
78
|
-
var unscrollableStyles = (0, _react2.css)({
|
|
79
|
-
flexShrink: 0
|
|
80
|
-
});
|
|
81
|
-
var thinSeparatorStyles = (0, _react2.css)({
|
|
82
|
-
borderBlockStart: "1px solid var(".concat(VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, ".concat(_colors.N30A, ")"), ")")
|
|
83
|
-
});
|
|
84
|
-
var noSeparatorStyles = (0, _react2.css)({
|
|
85
|
-
// this is to ensure that adjacent sections without separators don't get additional margins.
|
|
86
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
87
|
-
'[data-section] + &': {
|
|
88
|
-
marginBlockStart: -6
|
|
89
|
-
}
|
|
90
|
-
});
|
|
29
|
+
var sectionPaddingTopBottom = 6;
|
|
30
|
+
var styles = {
|
|
31
|
+
root: "_1ywu1ule _cfu11ule _1qdgi2wt _kfgti2wt _aetrb3bt _1kt9b3bt _1p3hi2wt _1l6bgktf _osbldlk8 _auo4rdoj _hp2110yn _1mfv8jkm _1bg41n1a",
|
|
32
|
+
scrollable: "_1reo1wug _18m91wug _1o9zkb7n",
|
|
33
|
+
unscrollable: "_1o9zidpf",
|
|
34
|
+
thinSeparator: "_mqm21imm",
|
|
35
|
+
noSeparator: "_n7cnyjp0",
|
|
36
|
+
sideNavSectionHeading: "_18zru2gc"
|
|
37
|
+
};
|
|
91
38
|
|
|
92
39
|
/**
|
|
93
40
|
* __Section__
|
|
@@ -99,7 +46,6 @@ var noSeparatorStyles = (0, _react2.css)({
|
|
|
99
46
|
*/
|
|
100
47
|
var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
101
48
|
var children = _ref.children,
|
|
102
|
-
overrides = _ref.overrides,
|
|
103
49
|
title = _ref.title,
|
|
104
50
|
titleId = _ref.titleId,
|
|
105
51
|
testId = _ref.testId,
|
|
@@ -108,12 +54,11 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
108
54
|
id = _ref.id,
|
|
109
55
|
_ref$isList = _ref.isList,
|
|
110
56
|
isList = _ref$isList === void 0 ? false : _ref$isList,
|
|
57
|
+
_ref$isSideNavSection = _ref.isSideNavSection,
|
|
58
|
+
isSideNavSection = _ref$isSideNavSection === void 0 ? false : _ref$isSideNavSection,
|
|
111
59
|
UNSAFE_className = _ref.className,
|
|
112
60
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
113
|
-
|
|
114
|
-
);
|
|
115
|
-
var UNSAFE_headingOverrides = overrides && overrides.HeadingItem && overrides.HeadingItem.cssFn;
|
|
116
|
-
var content = isList ? (0, _react2.jsx)("ul", {
|
|
61
|
+
var content = isList ? /*#__PURE__*/React.createElement("ul", {
|
|
117
62
|
style: {
|
|
118
63
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
119
64
|
margin: 0,
|
|
@@ -121,7 +66,7 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
121
66
|
padding: 0
|
|
122
67
|
}
|
|
123
68
|
}, _react.Children.map(_react.Children.toArray(children), function (child, index) {
|
|
124
|
-
return
|
|
69
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
125
70
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
126
71
|
style: {
|
|
127
72
|
listStyleType: 'none',
|
|
@@ -131,21 +76,22 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
131
76
|
key: index
|
|
132
77
|
}, child);
|
|
133
78
|
})) : children;
|
|
134
|
-
var childrenMarkup = title !== undefined ?
|
|
135
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
136
|
-
, {
|
|
137
|
-
cssFn: UNSAFE_headingOverrides,
|
|
79
|
+
var childrenMarkup = title !== undefined ? /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement(_headingItem.default, {
|
|
138
80
|
testId: testId && "".concat(testId, "--heading"),
|
|
139
81
|
"aria-hidden": true
|
|
140
|
-
|
|
141
|
-
|
|
82
|
+
// @ts-expect-error
|
|
83
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
|
|
84
|
+
,
|
|
85
|
+
className: (0, _runtime.ax)([isSideNavSection && styles.sideNavSectionHeading])
|
|
86
|
+
}, title), content) : /*#__PURE__*/React.createElement(_react.Fragment, null, content);
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, rest, {
|
|
142
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
143
|
-
className: UNSAFE_className,
|
|
89
|
+
className: (0, _runtime.ax)([styles.root, isScrollable ? styles.scrollable : styles.unscrollable, hasSeparator ? styles.thinSeparator : styles.noSeparator, UNSAFE_className]),
|
|
144
90
|
id: id
|
|
145
91
|
// NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
|
|
146
92
|
// We have made a deliberate choice to leave this behaviour as is.
|
|
147
93
|
,
|
|
148
|
-
|
|
94
|
+
|
|
149
95
|
"aria-label": title,
|
|
150
96
|
"aria-labelledby": titleId,
|
|
151
97
|
"data-testid": testId,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
3
|
+
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
4
|
+
._syaz1n3s{color:var(--ds-text-subtle,#5e6c84)}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
+
/* heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
import "./heading-item.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
|
|
11
|
-
import noop from '@atlaskit/ds-lib/noop';
|
|
12
7
|
import { N300 } from '@atlaskit/theme/colors';
|
|
13
|
-
const headingStyles =
|
|
14
|
-
color: `var(--ds-text-subtle, ${N300})`,
|
|
15
|
-
font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
16
|
-
paddingBlock: "var(--ds-space-0, 0px)",
|
|
17
|
-
paddingInline: "var(--ds-space-200, 16px)"
|
|
18
|
-
});
|
|
8
|
+
const headingStyles = null;
|
|
19
9
|
|
|
20
10
|
/**
|
|
21
11
|
* __Heading item__
|
|
@@ -30,7 +20,6 @@ const HeadingItem = /*#__PURE__*/memo(({
|
|
|
30
20
|
testId,
|
|
31
21
|
headingLevel = 2,
|
|
32
22
|
id,
|
|
33
|
-
cssFn = noop,
|
|
34
23
|
// Although this isn't defined on props it is available because we've used
|
|
35
24
|
// Spread props below and on the jsx element. To forcibly block usage I've
|
|
36
25
|
// picked it out and supressed the expected type error.
|
|
@@ -38,15 +27,7 @@ const HeadingItem = /*#__PURE__*/memo(({
|
|
|
38
27
|
className: UNSAFE_className,
|
|
39
28
|
...rest
|
|
40
29
|
}) => {
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
45
|
-
const UNSAFE_overrides = css(cssFn(undefined));
|
|
46
|
-
return jsx("div", _extends({
|
|
47
|
-
css: [headingStyles,
|
|
48
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
49
|
-
UNSAFE_overrides],
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
50
31
|
role: "heading",
|
|
51
32
|
"aria-level": headingLevel,
|
|
52
33
|
"data-testid": testId,
|
|
@@ -54,7 +35,7 @@ const HeadingItem = /*#__PURE__*/memo(({
|
|
|
54
35
|
id: id
|
|
55
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
56
37
|
,
|
|
57
|
-
className: UNSAFE_className
|
|
38
|
+
className: ax(["_11c81vhk _1rjcze3t _18zrpxbi _syaz1n3s", UNSAFE_className])
|
|
58
39
|
}, rest), children);
|
|
59
40
|
});
|
|
60
41
|
export default HeadingItem;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
+
/* menu-group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import "./menu-group.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
6
|
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE, SpacingContext } from '../internal/components/menu-context';
|
|
9
|
-
const baseStyles =
|
|
10
|
-
display: 'flex',
|
|
11
|
-
position: 'static',
|
|
12
|
-
flexDirection: 'column',
|
|
13
|
-
overflow: 'auto'
|
|
14
|
-
});
|
|
7
|
+
const baseStyles = null;
|
|
15
8
|
|
|
16
9
|
/**
|
|
17
10
|
* __Menu group__
|
|
@@ -36,11 +29,11 @@ const MenuGroup = ({
|
|
|
36
29
|
// @ts-expect-error
|
|
37
30
|
className: UNSAFE_className,
|
|
38
31
|
...rest
|
|
39
|
-
}) =>
|
|
32
|
+
}) => /*#__PURE__*/React.createElement(SpacingContext.Provider, {
|
|
40
33
|
value: spacing
|
|
41
|
-
},
|
|
34
|
+
}, /*#__PURE__*/React.createElement(SELECTION_STYLE_CONTEXT_DO_NOT_USE.Provider, {
|
|
42
35
|
value: "border"
|
|
43
|
-
},
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
44
37
|
"aria-busy": isLoading,
|
|
45
38
|
style: {
|
|
46
39
|
minWidth,
|
|
@@ -48,12 +41,11 @@ const MenuGroup = ({
|
|
|
48
41
|
minHeight,
|
|
49
42
|
maxHeight
|
|
50
43
|
},
|
|
51
|
-
css: baseStyles,
|
|
52
44
|
"data-testid": testId,
|
|
53
45
|
role: role
|
|
54
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
55
47
|
,
|
|
56
|
-
className: UNSAFE_className
|
|
48
|
+
className: ax(["_1reo1wug _18m91wug _1e0c1txw _kqswpfqs _2lx21bp4", UNSAFE_className])
|
|
57
49
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
58
50
|
}, rest))));
|
|
59
51
|
export default MenuGroup;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
/* popup-menu-group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
|
|
6
|
+
|
|
8
7
|
import MenuGroup from './menu-group';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -15,8 +14,9 @@ const PopupMenuGroup = ({
|
|
|
15
14
|
minWidth = 320,
|
|
16
15
|
...rest
|
|
17
16
|
}) =>
|
|
17
|
+
/*#__PURE__*/
|
|
18
18
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
19
|
-
|
|
19
|
+
React.createElement(MenuGroup, _extends({
|
|
20
20
|
maxWidth: maxWidth,
|
|
21
21
|
minWidth: minWidth
|
|
22
22
|
}, rest));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._18zru2gc{padding-inline:var(--ds-space-100,8px)}
|
|
3
|
+
._mqm21imm{border-block-start:1px solid var(--ds-menu-seperator-color,var(--ds-border,rgba(9,30,66,.08)))}._18m91wug{overflow-y:auto}
|
|
4
|
+
._1l6bgktf [data-ds--menu--heading-item]{margin-block-start:20px}
|
|
5
|
+
._1mfv8jkm [data-ds--menu--skeleton-heading-item]:first-of-type{margin-block-start:19px}
|
|
6
|
+
._1o9zidpf{flex-shrink:0}
|
|
7
|
+
._1o9zkb7n{flex-shrink:1}
|
|
8
|
+
._1p3hi2wt [data-ds--menu--heading-item]{margin-block-end:6px}
|
|
9
|
+
._1qdgi2wt:after, ._kfgti2wt:before{height:6px}
|
|
10
|
+
._1reo1wug{overflow-x:auto}
|
|
11
|
+
._1ywu1ule:after, ._cfu11ule:before{display:block}
|
|
12
|
+
._aetrb3bt:after, ._1kt9b3bt:before{content:""}
|
|
13
|
+
._auo4rdoj [data-ds--menu--skeleton-heading-item]{margin-block-end:9px}
|
|
14
|
+
._hp2110yn [data-ds--menu--skeleton-heading-item]{margin-block-start:25px}
|
|
15
|
+
._osbldlk8 [data-ds--menu--heading-item]:first-of-type{margin-block-start:14px}
|
|
16
|
+
[data-section]+._n7cnyjp0{margin-block-start:-6px}
|
|
17
|
+
._1bg41n1a:focus{outline-offset:-1px}
|