@atlaskit/menu 3.2.0 → 5.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 +30 -0
- package/dist/cjs/internal/components/menu-item-primitive.compiled.css +81 -0
- package/dist/cjs/internal/components/menu-item-primitive.js +51 -181
- package/dist/cjs/menu-item/button-item.js +11 -25
- package/dist/cjs/menu-item/custom-item.js +14 -28
- package/dist/cjs/menu-item/link-item.js +12 -27
- package/dist/cjs/menu-item/skeleton-heading-item.js +1 -4
- package/dist/cjs/menu-item/skeleton-item.js +1 -4
- package/dist/cjs/menu-section/section.js +1 -4
- package/dist/es2019/internal/components/menu-item-primitive.compiled.css +81 -0
- package/dist/es2019/internal/components/menu-item-primitive.js +46 -179
- package/dist/es2019/menu-item/button-item.js +6 -23
- package/dist/es2019/menu-item/custom-item.js +8 -27
- package/dist/es2019/menu-item/link-item.js +7 -25
- package/dist/es2019/menu-item/skeleton-heading-item.js +1 -4
- package/dist/es2019/menu-item/skeleton-item.js +1 -4
- package/dist/es2019/menu-section/section.js +1 -4
- package/dist/esm/internal/components/menu-item-primitive.compiled.css +81 -0
- package/dist/esm/internal/components/menu-item-primitive.js +47 -178
- package/dist/esm/menu-item/button-item.js +7 -25
- package/dist/esm/menu-item/custom-item.js +10 -29
- package/dist/esm/menu-item/link-item.js +8 -27
- package/dist/esm/menu-item/skeleton-heading-item.js +1 -4
- package/dist/esm/menu-item/skeleton-item.js +1 -4
- package/dist/esm/menu-section/section.js +1 -4
- package/dist/types/internal/components/menu-item-primitive.d.ts +2 -2
- package/dist/types/types.d.ts +11 -19
- package/dist/types-ts4.5/internal/components/menu-item-primitive.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +11 -19
- package/package.json +16 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#146281](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146281)
|
|
8
|
+
[`ebb2af6f3c40f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ebb2af6f3c40f) -
|
|
9
|
+
Removed deprecated `overrides` props from ButtonItem, CustomItem, and LinkItem, and from the
|
|
10
|
+
BaseItemProps type export. Introduced `isTitleHeading` prop on CustomItem which when true renders
|
|
11
|
+
its children in a `h2` element rather than the default `span`.
|
|
12
|
+
|
|
13
|
+
## 4.0.0
|
|
14
|
+
|
|
15
|
+
### Major Changes
|
|
16
|
+
|
|
17
|
+
- [#141631](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141631)
|
|
18
|
+
[`064a20b174719`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/064a20b174719) - -
|
|
19
|
+
Migrated `ButtonItem`, `LinkItem` and `CustomItem` components from `@emotion/react` to
|
|
20
|
+
`@compiled/react` in order to improve performance, align with the rest of the Atlaskit techstack,
|
|
21
|
+
and support React 18 Streaming SSR.
|
|
22
|
+
|
|
23
|
+
- Removed the deprecated `cssFn` prop from `ButtonItem`, `LinkItem` and `CustomItem` components.
|
|
24
|
+
|
|
25
|
+
Please note, in order to use this version of `@atlaskit/menu`, you will need to ensure that your
|
|
26
|
+
bundler is configured to handle `.css` imports correctly.
|
|
27
|
+
|
|
28
|
+
Most bundlers come with built-in support for `.css` imports, so you may not need to do anything.
|
|
29
|
+
If you are using a different bundler, please refer to the documentation for that bundler to
|
|
30
|
+
understand how to handle `.css` imports. For more information on the migration, please refer to
|
|
31
|
+
[RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
|
|
32
|
+
|
|
3
33
|
## 3.2.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
|
|
2
|
+
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
+
._11c8dcr7{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
|
+
._19itidpf{border:0}
|
|
5
|
+
._rfx315o9:before{border-radius:0 var(--ds-border-radius,4px) var(--ds-border-radius,4px) 0}
|
|
6
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
7
|
+
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
8
|
+
._1rjc1b66{padding-block:var(--ds-space-050,4px)}
|
|
9
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
10
|
+
._12ji1r31{outline-color:currentColor}
|
|
11
|
+
._12y31o36{outline-width:medium}
|
|
12
|
+
._12y3idpf{outline-width:0}
|
|
13
|
+
._16jlkb7n{flex-grow:1}
|
|
14
|
+
._18m915vq{overflow-y:hidden}
|
|
15
|
+
._18u0ze3t{margin-left:var(--ds-space-0,0)}
|
|
16
|
+
._19pkze3t{margin-top:var(--ds-space-0,0)}
|
|
17
|
+
._1bah1h6o{justify-content:center}
|
|
18
|
+
._1bsb1osq{width:100%}
|
|
19
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
20
|
+
._1cs8stnw:before{position:absolute}
|
|
21
|
+
._1e0c1txw{display:flex}
|
|
22
|
+
._1e0c1ule{display:block}
|
|
23
|
+
._1fkrutpp:before{inset-block-end:var(--ds-space-150,9pt)}
|
|
24
|
+
._1fkrze3t:before{inset-block-end:var(--ds-space-0,0)}
|
|
25
|
+
._1hmsglyw{text-decoration-line:none}
|
|
26
|
+
._1kt9b3bt:before{content:""}
|
|
27
|
+
._1mp41y44:before{width:4px}
|
|
28
|
+
._1mp4yh40:before{width:2px}
|
|
29
|
+
._1nmz1hna{word-break:break-word}
|
|
30
|
+
._1o9zidpf{flex-shrink:0}
|
|
31
|
+
._1qu2glyw{outline-style:none}
|
|
32
|
+
._1reo15vq{overflow-x:hidden}
|
|
33
|
+
._1rus67is:before{background-color:var(--ds-border-selected,transparent)}
|
|
34
|
+
._1tke1tcg{min-height:24px}
|
|
35
|
+
._1tke1ylp{min-height:40px}
|
|
36
|
+
._1tkezwfg{min-height:2pc}
|
|
37
|
+
._1ul91tcg{min-width:24px}
|
|
38
|
+
._2hwxze3t{margin-right:var(--ds-space-0,0)}
|
|
39
|
+
._2lx21bp4{flex-direction:column}
|
|
40
|
+
._4bfu1r31{text-decoration-color:currentColor}
|
|
41
|
+
._4cvr1h6o{align-items:center}
|
|
42
|
+
._80om13gf{cursor:not-allowed}
|
|
43
|
+
._80omtlke{cursor:pointer}
|
|
44
|
+
._ajmmnqa1{text-decoration-style:solid}
|
|
45
|
+
._bfhk1q4k{background-color:var(--ds-background-selected,#f4f5f7)}
|
|
46
|
+
._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
|
|
47
|
+
._iajmutpp:before{inset-block-start:var(--ds-space-150,9pt)}
|
|
48
|
+
._iajmze3t:before{inset-block-start:var(--ds-space-0,0)}
|
|
49
|
+
._kqswh2mm{position:relative}
|
|
50
|
+
._o5721q9c{white-space:nowrap}
|
|
51
|
+
._otyrze3t{margin-bottom:var(--ds-space-0,0)}
|
|
52
|
+
._syaz1r31{color:currentColor}
|
|
53
|
+
._syaz1wmz{color:var(--ds-text-subtlest,#6b778c)}
|
|
54
|
+
._syaz2oi6{color:var(--ds-text-disabled,#6b778c)}
|
|
55
|
+
._syazhu5v{color:var(--ds-text-selected,currentColor)}
|
|
56
|
+
._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
|
|
57
|
+
._vchhusvi{box-sizing:border-box}
|
|
58
|
+
._y3gn1e5h{text-align:left}
|
|
59
|
+
._z5wtze3t:before{inset-inline-start:var(--ds-space-0,0)}._10531r31:visited{color:currentColor}
|
|
60
|
+
._1053hu5v:visited{color:var(--ds-text-selected,currentColor)}
|
|
61
|
+
._128m1bk5:focus-visible{outline-width:var(--ds-border-width-outline,2px)}
|
|
62
|
+
._1ah311pw:focus-visible{outline-offset:calc(0px - var(--ds-border-width-outline, 2px))}
|
|
63
|
+
._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
|
|
64
|
+
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
65
|
+
._1bnxglyw:hover{text-decoration-line:none}
|
|
66
|
+
._30l316ov:hover{color:var(--ds-text-accent-blue,currentColor)}
|
|
67
|
+
._30l31r31:hover{color:currentColor}
|
|
68
|
+
._30l32oi6:hover{color:var(--ds-text-disabled,#6b778c)}
|
|
69
|
+
._30l3hu5v:hover{color:var(--ds-text-selected,currentColor)}
|
|
70
|
+
._9oik1r31:hover{text-decoration-color:currentColor}
|
|
71
|
+
._irr31dko:hover{background-color:var(--ds-background-neutral-subtle-hovered,#f4f5f7)}
|
|
72
|
+
._irr32seo:hover{background-color:var(--ds-background-selected-hovered,#f4f5f7)}
|
|
73
|
+
._irr3qtfy:hover{background-color:var(--ds-background-neutral-subtle,transparent)}
|
|
74
|
+
._jf4cnqa1:hover{text-decoration-style:solid}
|
|
75
|
+
._1di61dko:active{background-color:var(--ds-background-neutral-subtle-hovered,#f4f5f7)}
|
|
76
|
+
._1di6guph:active{background-color:var(--ds-background-selected-pressed,#ebecf0)}
|
|
77
|
+
._1di6qtfy:active{background-color:var(--ds-background-neutral-subtle,transparent)}
|
|
78
|
+
._9h8h1r31:active{color:currentColor}
|
|
79
|
+
._9h8h2oi6:active{color:var(--ds-text-disabled,#6b778c)}
|
|
80
|
+
._9h8hhu5v:active{color:var(--ds-text-selected,currentColor)}
|
|
81
|
+
@media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._1cvmnqa1:focus-visible{outline-style:solid}._4davt94y:focus-visible{outline-width:1px}}
|
|
@@ -1,170 +1,48 @@
|
|
|
1
|
+
/* menu-item-primitive.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
require("./menu-item-primitive.compiled.css");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var React = _react;
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var
|
|
14
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
15
|
var _menuContext = require("./menu-context");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
|
-
|
|
23
|
-
var defaultRender = function defaultRender(Component, props) {
|
|
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
|
+
var renderTitle = function renderTitle(Component, props) {
|
|
24
19
|
return (
|
|
20
|
+
/*#__PURE__*/
|
|
25
21
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
26
|
-
|
|
22
|
+
React.createElement(Component, props)
|
|
27
23
|
);
|
|
28
24
|
};
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
textAlign: 'left'
|
|
47
|
-
});
|
|
48
|
-
var truncateStyles = (0, _react2.css)({
|
|
49
|
-
display: 'block',
|
|
50
|
-
overflow: 'hidden',
|
|
51
|
-
textOverflow: 'ellipsis',
|
|
52
|
-
whiteSpace: 'nowrap'
|
|
53
|
-
});
|
|
54
|
-
var titleStyles = (0, _react2.css)({
|
|
55
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
|
|
56
|
-
});
|
|
57
|
-
var wordBreakStyles = (0, _react2.css)({
|
|
58
|
-
wordBreak: 'break-word'
|
|
59
|
-
});
|
|
60
|
-
var descriptionStyles = (0, _react2.css)({
|
|
61
|
-
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
62
|
-
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
|
|
63
|
-
});
|
|
64
|
-
var disabledDescriptionStyles = (0, _react2.css)({
|
|
65
|
-
color: "var(--ds-text-disabled, ".concat(_colors.N200, ")")
|
|
66
|
-
});
|
|
67
|
-
var positionRelativeStyles = (0, _react2.css)({
|
|
68
|
-
position: 'relative'
|
|
69
|
-
});
|
|
70
|
-
var primitiveStyles = (0, _react2.css)({
|
|
71
|
-
display: 'flex',
|
|
72
|
-
boxSizing: 'border-box',
|
|
73
|
-
width: '100%',
|
|
74
|
-
minHeight: 40,
|
|
75
|
-
margin: "var(--ds-space-0, 0px)",
|
|
76
|
-
alignItems: 'center',
|
|
77
|
-
border: 0,
|
|
78
|
-
outline: 0,
|
|
79
|
-
textDecoration: 'none',
|
|
80
|
-
userSelect: 'none',
|
|
81
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
82
|
-
'&::-moz-focus-inner': {
|
|
83
|
-
border: 0
|
|
84
|
-
},
|
|
85
|
-
'&:hover': {
|
|
86
|
-
textDecoration: 'none'
|
|
87
|
-
}
|
|
88
|
-
});
|
|
25
|
+
var styles = {
|
|
26
|
+
root: "_19itidpf _12ji1r31 _1qu2glyw _12y3idpf _4bfu1r31 _1hmsglyw _ajmmnqa1 _kqswh2mm _1e0c1txw _vchhusvi _1bsb1osq _1tke1ylp _19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _4cvr1h6o _uiztglyw _80omtlke _mizu194a _1ah311pw _ra3xnqa1 _128m1bk5 _9oik1r31 _1bnxglyw _jf4cnqa1 _1cvmnqa1 _4davt94y",
|
|
27
|
+
beforeAfterElementOld: "_1e0c1txw _4cvr1h6o _1bah1h6o _1o9zidpf",
|
|
28
|
+
beforeAfterElement: "_1e0c1txw _1ul91tcg _1tke1tcg _4cvr1h6o _1bah1h6o _1o9zidpf",
|
|
29
|
+
content: "_12ji1r31 _1qu2glyw _12y31o36 _1reo15vq _18m915vq _1e0c1txw _2lx21bp4 _1bah1h6o _16jlkb7n _y3gn1e5h",
|
|
30
|
+
truncate: "_1reo15vq _18m915vq _1e0c1ule _1bto1l2s _o5721q9c",
|
|
31
|
+
title: "_11c82smr",
|
|
32
|
+
wordBreak: "_1nmz1hna",
|
|
33
|
+
description: "_11c8dcr7 _syaz1wmz",
|
|
34
|
+
disabledDescription: "_syaz2oi6",
|
|
35
|
+
unselected: "_bfhkqtfy _syaz1r31 _10531r31 _irr31dko _30l31r31 _1di61dko _9h8h1r31",
|
|
36
|
+
disabled: "_80om13gf _bfhkqtfy _syaz2oi6 _irr3qtfy _30l32oi6 _1di6qtfy _9h8h2oi6",
|
|
37
|
+
selectedBorder: "_1mp4yh40 _1cs8stnw _1rus67is _1kt9b3bt _1fkrze3t _iajmze3t _z5wtze3t",
|
|
38
|
+
selectedNotch: "_rfx315o9 _1mp41y44 _1cs8stnw _1rus67is _1kt9b3bt _1fkrutpp _iajmutpp _z5wtze3t",
|
|
39
|
+
selected: "_bfhk1q4k _syazhu5v _1053hu5v _irr32seo _30l316ov _1di6guph _9h8hhu5v",
|
|
40
|
+
selectedOld: "_30l3hu5v"
|
|
41
|
+
};
|
|
89
42
|
var spacingMapStyles = {
|
|
90
|
-
cozy:
|
|
91
|
-
|
|
92
|
-
paddingBlock: "var(--ds-space-100, 8px)",
|
|
93
|
-
paddingInline: "var(--ds-space-200, 16px)"
|
|
94
|
-
}),
|
|
95
|
-
compact: (0, _react2.css)({
|
|
96
|
-
minHeight: 32,
|
|
97
|
-
// 4 * 2 (8) + icon (24) === 32
|
|
98
|
-
paddingBlock: "var(--ds-space-050, 4px)",
|
|
99
|
-
paddingInline: "var(--ds-space-150, 12px)"
|
|
100
|
-
})
|
|
43
|
+
cozy: "_1rjcu2gc _18zrpxbi",
|
|
44
|
+
compact: "_1rjc1b66 _18zrutpp _1tkezwfg"
|
|
101
45
|
};
|
|
102
|
-
var interactiveStyles = (0, _react2.css)({
|
|
103
|
-
cursor: 'pointer'
|
|
104
|
-
});
|
|
105
|
-
var unselectedStyles = (0, _react2.css)({
|
|
106
|
-
backgroundColor: "var(--ds-background-neutral-subtle, transparent)",
|
|
107
|
-
color: 'currentColor',
|
|
108
|
-
'&:visited': {
|
|
109
|
-
color: 'currentColor'
|
|
110
|
-
},
|
|
111
|
-
'&:hover': {
|
|
112
|
-
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"),
|
|
113
|
-
color: 'currentColor'
|
|
114
|
-
},
|
|
115
|
-
'&:active': {
|
|
116
|
-
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.N30, ")"),
|
|
117
|
-
boxShadow: 'none',
|
|
118
|
-
color: 'currentColor'
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
var disabledStyles = (0, _react2.css)({
|
|
122
|
-
cursor: 'not-allowed',
|
|
123
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
124
|
-
'&, :hover, :active': {
|
|
125
|
-
backgroundColor: "var(--ds-background-neutral-subtle, transparent)",
|
|
126
|
-
color: "var(--ds-text-disabled, ".concat(_colors.N200, ")")
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
var selectedBorderStyles = (0, _react2.css)({
|
|
130
|
-
'&::before': {
|
|
131
|
-
width: 2,
|
|
132
|
-
position: 'absolute',
|
|
133
|
-
background: "var(--ds-border-selected, transparent)",
|
|
134
|
-
content: '""',
|
|
135
|
-
insetBlockEnd: 0,
|
|
136
|
-
insetBlockStart: 0,
|
|
137
|
-
insetInlineStart: 0
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
var selectedNotchStyles = (0, _react2.css)({
|
|
141
|
-
'&::before': {
|
|
142
|
-
width: 4,
|
|
143
|
-
position: 'absolute',
|
|
144
|
-
background: "var(--ds-border-selected, transparent)",
|
|
145
|
-
borderRadius: "0 ".concat("var(--ds-border-radius, 4px)", " ", "var(--ds-border-radius, 4px)", " 0"),
|
|
146
|
-
content: '""',
|
|
147
|
-
insetBlockEnd: "var(--ds-space-150, 12px)",
|
|
148
|
-
insetBlockStart: "var(--ds-space-150, 12px)",
|
|
149
|
-
insetInlineStart: 0
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
var selectedStyles = (0, _react2.css)({
|
|
153
|
-
backgroundColor: "var(--ds-background-selected, ".concat(_colors.N20, ")"),
|
|
154
|
-
// Fallback set as babel plugin inserts one otherwise
|
|
155
|
-
color: "var(--ds-text-selected, currentColor)",
|
|
156
|
-
'&:visited': {
|
|
157
|
-
color: "var(--ds-text-selected, currentColor)"
|
|
158
|
-
},
|
|
159
|
-
'&:hover': {
|
|
160
|
-
backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.N20, ")"),
|
|
161
|
-
color: "var(--ds-text-selected, currentColor)"
|
|
162
|
-
},
|
|
163
|
-
'&:active': {
|
|
164
|
-
backgroundColor: "var(--ds-background-selected-pressed, ".concat(_colors.N30, ")"),
|
|
165
|
-
color: "var(--ds-text-selected, currentColor)"
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
46
|
var gapMap = {
|
|
169
47
|
compact: 'space.100',
|
|
170
48
|
cozy: 'space.150'
|
|
@@ -190,7 +68,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
|
|
|
190
68
|
description = _ref.description,
|
|
191
69
|
iconAfter = _ref.iconAfter,
|
|
192
70
|
iconBefore = _ref.iconBefore,
|
|
193
|
-
overrides = _ref.overrides,
|
|
194
71
|
UNSAFE_externalClassName = _ref.className,
|
|
195
72
|
_ref$shouldTitleWrap = _ref.shouldTitleWrap,
|
|
196
73
|
shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? false : _ref$shouldTitleWrap,
|
|
@@ -200,48 +77,41 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
|
|
|
200
77
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
201
78
|
_ref$isSelected = _ref.isSelected,
|
|
202
79
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
80
|
+
_ref$isTitleHeading = _ref.isTitleHeading,
|
|
81
|
+
isTitleHeading = _ref$isTitleHeading === void 0 ? false : _ref$isTitleHeading,
|
|
203
82
|
testId = _ref.testId;
|
|
204
|
-
(0, _deprecationWarning.propDeprecationWarning)("@atlaskit/menu" || '', 'overrides', overrides !== undefined, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
|
|
205
|
-
);
|
|
206
83
|
var spacing = (0, _react.useContext)(_menuContext.SpacingContext);
|
|
207
84
|
var selectionStyle = (0, _react.useContext)(_menuContext.SELECTION_STYLE_CONTEXT_DO_NOT_USE);
|
|
208
|
-
var renderTitle = overrides && overrides.Title && overrides.Title.render || defaultRender;
|
|
209
85
|
var UNSAFE_className = UNSAFE_externalClassName;
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
isInset: true
|
|
215
|
-
}, children({
|
|
216
|
-
className: cx([cn([positionRelativeStyles, primitiveStyles, spacingMapStyles[spacing], !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && [selectedStyles, [selectionStyle === 'border' && selectedBorderStyles, selectionStyle === 'notch' && selectedNotchStyles]], isDisabled ? disabledStyles : interactiveStyles]), UNSAFE_className]),
|
|
217
|
-
children: (0, _react2.jsx)(_primitives.Inline, {
|
|
86
|
+
return function () {
|
|
87
|
+
return children({
|
|
88
|
+
className: (0, _runtime.ax)([(0, _runtime.ax)([styles.root, spacingMapStyles[spacing], !isDisabled && !isSelected && styles.unselected, !isDisabled && isSelected && styles.selected, !(0, _platformFeatureFlags.fg)('platform_fix_a11y_selected_and_hovered_state_color') && !isDisabled && isSelected && styles.selectedOld, !isDisabled && isSelected && selectionStyle === 'border' && styles.selectedBorder, !isDisabled && isSelected && selectionStyle === 'notch' && styles.selectedNotch, isDisabled && styles.disabled]), UNSAFE_className]),
|
|
89
|
+
children: /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
218
90
|
as: "span",
|
|
219
91
|
spread: "space-between",
|
|
220
92
|
alignBlock: "center",
|
|
221
93
|
space: gapMap[spacing],
|
|
222
94
|
grow: "fill",
|
|
223
95
|
testId: testId && "".concat(testId, "--container")
|
|
224
|
-
}, iconBefore &&
|
|
96
|
+
}, iconBefore && /*#__PURE__*/React.createElement("span", {
|
|
225
97
|
"data-item-elem-before": true,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}, iconBefore), title &&
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
xcss: contentStyles
|
|
232
|
-
}, renderTitle('span', {
|
|
98
|
+
"data-testid": testId && "".concat(testId, "--icon-before"),
|
|
99
|
+
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') && styles.beforeAfterElement, !(0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') && styles.beforeAfterElementOld])
|
|
100
|
+
}, iconBefore), title && /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: (0, _runtime.ax)([styles.content])
|
|
102
|
+
}, renderTitle(isTitleHeading ? 'h2' : 'span', {
|
|
233
103
|
children: title,
|
|
234
|
-
className:
|
|
104
|
+
className: (0, _runtime.ax)([styles.title, shouldTitleWrap ? styles.wordBreak : styles.truncate]),
|
|
235
105
|
'data-item-title': true
|
|
236
|
-
}), description &&
|
|
106
|
+
}), description && /*#__PURE__*/React.createElement("span", {
|
|
237
107
|
"data-item-description": true,
|
|
238
|
-
|
|
239
|
-
}, description)), iconAfter &&
|
|
108
|
+
className: (0, _runtime.ax)([styles.description, isDisabled && styles.disabledDescription, shouldDescriptionWrap && styles.wordBreak, !shouldDescriptionWrap && styles.truncate])
|
|
109
|
+
}, description)), iconAfter && /*#__PURE__*/React.createElement("span", {
|
|
240
110
|
"data-item-elem-after": true,
|
|
241
|
-
|
|
242
|
-
|
|
111
|
+
"data-testid": testId && "".concat(testId, "--icon-after"),
|
|
112
|
+
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') && styles.beforeAfterElement, !(0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') && styles.beforeAfterElementOld])
|
|
243
113
|
}, iconAfter))
|
|
244
|
-
})
|
|
245
|
-
});
|
|
114
|
+
});
|
|
115
|
+
}();
|
|
246
116
|
};
|
|
247
117
|
var _default = exports.default = MenuItemPrimitive;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
+
/* button-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
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var React = _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("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
15
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
15
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
|
|
17
|
-
var _excluded = ["children", "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @jsx jsx
|
|
21
|
-
*/
|
|
22
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
+
var _excluded = ["children", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "interactionName"];
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
23
21
|
/**
|
|
24
22
|
* __Button item__
|
|
25
23
|
*
|
|
@@ -32,8 +30,6 @@ var ButtonItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
|
|
|
32
30
|
// Type needed on props to extract types with extract react types.
|
|
33
31
|
function (props, ref) {
|
|
34
32
|
var children = props.children,
|
|
35
|
-
_props$cssFn = props.cssFn,
|
|
36
|
-
cssFn = _props$cssFn === void 0 ? _noop.default : _props$cssFn,
|
|
37
33
|
description = props.description,
|
|
38
34
|
iconAfter = props.iconAfter,
|
|
39
35
|
iconBefore = props.iconBefore,
|
|
@@ -43,7 +39,6 @@ function (props, ref) {
|
|
|
43
39
|
isSelected = _props$isSelected === void 0 ? false : _props$isSelected,
|
|
44
40
|
onClick = props.onClick,
|
|
45
41
|
testId = props.testId,
|
|
46
|
-
overrides = props.overrides,
|
|
47
42
|
onMouseDown = props.onMouseDown,
|
|
48
43
|
shouldTitleWrap = props.shouldTitleWrap,
|
|
49
44
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
@@ -59,34 +54,25 @@ function (props, ref) {
|
|
|
59
54
|
if (!children) {
|
|
60
55
|
return null;
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
);
|
|
64
|
-
return (0, _react2.jsx)(_menuItemPrimitive.default
|
|
57
|
+
return /*#__PURE__*/React.createElement(_menuItemPrimitive.default
|
|
65
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
66
59
|
, (0, _extends2.default)({
|
|
67
60
|
className: UNSAFE_className
|
|
68
61
|
}, rest, {
|
|
69
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
70
|
-
overrides: overrides,
|
|
71
62
|
iconBefore: iconBefore,
|
|
72
63
|
iconAfter: iconAfter,
|
|
73
64
|
isDisabled: isDisabled,
|
|
74
65
|
isSelected: isSelected,
|
|
66
|
+
isTitleHeading: false,
|
|
75
67
|
description: description,
|
|
76
68
|
title: children,
|
|
77
69
|
shouldTitleWrap: shouldTitleWrap,
|
|
78
70
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
79
|
-
css:
|
|
80
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
81
|
-
cssFn({
|
|
82
|
-
isSelected: isSelected,
|
|
83
|
-
isDisabled: isDisabled
|
|
84
|
-
}),
|
|
85
71
|
testId: testId && "".concat(testId, "--primitive")
|
|
86
72
|
}), function (_ref) {
|
|
87
73
|
var children = _ref.children,
|
|
88
74
|
className = _ref.className;
|
|
89
|
-
return
|
|
75
|
+
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
|
|
90
76
|
"data-testid": testId
|
|
91
77
|
}, rest, {
|
|
92
78
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
+
/* custom-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
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var React = _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("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
15
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
15
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
|
|
17
|
-
var _excluded = ["component", "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @jsx jsx
|
|
21
|
-
*/
|
|
22
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
+
var _excluded = ["component", "isDisabled", "isSelected", "isTitleHeading", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_isDraggable", "interactionName"];
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
23
21
|
var preventEvent = function preventEvent(e) {
|
|
24
22
|
e.preventDefault();
|
|
25
23
|
};
|
|
@@ -36,19 +34,18 @@ var preventEvent = function preventEvent(e) {
|
|
|
36
34
|
*/
|
|
37
35
|
var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
38
36
|
var Component = _ref.component,
|
|
39
|
-
_ref$cssFn = _ref.cssFn,
|
|
40
|
-
cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn,
|
|
41
37
|
_ref$isDisabled = _ref.isDisabled,
|
|
42
38
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
43
39
|
_ref$isSelected = _ref.isSelected,
|
|
44
40
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
41
|
+
_ref$isTitleHeading = _ref.isTitleHeading,
|
|
42
|
+
isTitleHeading = _ref$isTitleHeading === void 0 ? false : _ref$isTitleHeading,
|
|
45
43
|
onClick = _ref.onClick,
|
|
46
44
|
testId = _ref.testId,
|
|
47
45
|
children = _ref.children,
|
|
48
46
|
description = _ref.description,
|
|
49
47
|
iconAfter = _ref.iconAfter,
|
|
50
48
|
iconBefore = _ref.iconBefore,
|
|
51
|
-
overrides = _ref.overrides,
|
|
52
49
|
onMouseDown = _ref.onMouseDown,
|
|
53
50
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
54
51
|
shouldDescriptionWrap = _ref.shouldDescriptionWrap,
|
|
@@ -65,36 +62,25 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
|
|
|
65
62
|
if (!Component) {
|
|
66
63
|
return null;
|
|
67
64
|
}
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
return (0, _react2.jsx)(_menuItemPrimitive.default
|
|
65
|
+
return /*#__PURE__*/React.createElement(_menuItemPrimitive.default
|
|
71
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
72
67
|
, (0, _extends2.default)({
|
|
73
68
|
className: UNSAFE_className
|
|
74
69
|
}, rest, {
|
|
75
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
76
|
-
overrides: overrides,
|
|
77
70
|
description: description,
|
|
78
71
|
iconAfter: iconAfter,
|
|
79
72
|
title: children,
|
|
80
73
|
iconBefore: iconBefore,
|
|
81
74
|
isSelected: isSelected,
|
|
82
75
|
isDisabled: isDisabled,
|
|
76
|
+
isTitleHeading: isTitleHeading,
|
|
83
77
|
shouldTitleWrap: shouldTitleWrap,
|
|
84
|
-
shouldDescriptionWrap: shouldDescriptionWrap
|
|
85
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
86
|
-
,
|
|
87
|
-
css: (0, _react2.css)(
|
|
88
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
89
|
-
cssFn({
|
|
90
|
-
isDisabled: isDisabled,
|
|
91
|
-
isSelected: isSelected
|
|
92
|
-
})),
|
|
78
|
+
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
93
79
|
testId: testId && "".concat(testId, "--primitive")
|
|
94
80
|
}), function (_ref2) {
|
|
95
81
|
var children = _ref2.children,
|
|
96
82
|
className = _ref2.className;
|
|
97
|
-
return
|
|
83
|
+
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({
|
|
98
84
|
"data-testid": testId
|
|
99
85
|
}, rest, {
|
|
100
86
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|