@atlaskit/dropdown-menu 11.11.5 → 11.12.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 +12 -0
- package/dist/cjs/dropdown-menu.js +3 -1
- package/dist/cjs/internal/components/checkbox-icon.js +3 -2
- package/dist/cjs/internal/components/radio-icon.js +3 -2
- package/dist/es2019/dropdown-menu.js +2 -1
- package/dist/es2019/internal/components/checkbox-icon.js +4 -3
- package/dist/es2019/internal/components/radio-icon.js +4 -3
- package/dist/esm/dropdown-menu.js +3 -1
- package/dist/esm/internal/components/checkbox-icon.js +4 -3
- package/dist/esm/internal/components/radio-icon.js +4 -3
- package/dist/types/types.d.ts +6 -0
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/package.json +9 -5
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 11.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b66fdec7fd1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b66fdec7fd1) - Add a new prop `shouldRenderToParent` to allow render content into a DOM node within the parent DOM hierarchy instead of React portal.
|
|
8
|
+
|
|
9
|
+
## 11.11.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d420deeebe5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d420deeebe5) - Fix checkbox and radio item color contrast issue under feature flag
|
|
14
|
+
|
|
3
15
|
## 11.11.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -85,6 +85,8 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
85
85
|
spacing = props.spacing,
|
|
86
86
|
_props$shouldFlip = props.shouldFlip,
|
|
87
87
|
shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip,
|
|
88
|
+
_props$shouldRenderTo = props.shouldRenderToParent,
|
|
89
|
+
shouldRenderToParent = _props$shouldRenderTo === void 0 ? false : _props$shouldRenderTo,
|
|
88
90
|
_props$isLoading = props.isLoading,
|
|
89
91
|
isLoading = _props$isLoading === void 0 ? false : _props$isLoading,
|
|
90
92
|
_props$autoFocus = props.autoFocus,
|
|
@@ -186,7 +188,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
186
188
|
fallbackPlacements: fallbackPlacements,
|
|
187
189
|
testId: testId && "".concat(testId, "--content"),
|
|
188
190
|
shouldUseCaptureOnOutsideClick: true,
|
|
189
|
-
shouldRenderToParent: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ?
|
|
191
|
+
shouldRenderToParent: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
|
|
190
192
|
trigger: function trigger(triggerProps) {
|
|
191
193
|
if (typeof _trigger === 'function') {
|
|
192
194
|
var ref = triggerProps.ref,
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
12
|
/**
|
|
12
13
|
* __Checkbox icon__
|
|
@@ -31,8 +32,8 @@ var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
|
31
32
|
width: "12",
|
|
32
33
|
height: "12",
|
|
33
34
|
rx: "2",
|
|
34
|
-
stroke: checked ? "var(--ds-border-selected, ".concat(_colors.B400, ")") : "var(--ds-border-input, ".concat(_colors.N40, ")"),
|
|
35
|
-
strokeWidth: 2
|
|
35
|
+
stroke: checked ? "var(--ds-border-selected, ".concat(_colors.B400, ")") : "var(--ds-border-input, ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.border-checkbox_nyoiu') ? _colors.N100 : _colors.N40, ")"),
|
|
36
|
+
strokeWidth: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
36
37
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
37
38
|
d: "M9.707 11.293a1 1 0 10-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 10-1.414-1.414L11 12.586l-1.293-1.293z",
|
|
38
39
|
fill: "inherit"
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
12
|
/**
|
|
12
13
|
* __Radio icon__
|
|
@@ -29,8 +30,8 @@ var RadioIcon = function RadioIcon(_ref) {
|
|
|
29
30
|
cx: "12",
|
|
30
31
|
cy: "12",
|
|
31
32
|
r: "6",
|
|
32
|
-
stroke: checked ? "var(--ds-border-selected, ".concat(_colors.B400, ")") : "var(--ds-border-input, ".concat(_colors.N40, ")"),
|
|
33
|
-
strokeWidth: 2
|
|
33
|
+
stroke: checked ? "var(--ds-border-selected, ".concat(_colors.B400, ")") : "var(--ds-border-input, ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.border-checkbox_nyoiu') ? _colors.N100 : _colors.N40, ")"),
|
|
34
|
+
strokeWidth: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
34
35
|
}), /*#__PURE__*/_react.default.createElement("circle", {
|
|
35
36
|
fill: "inherit",
|
|
36
37
|
cx: "12",
|
|
@@ -67,6 +67,7 @@ const DropdownMenu = props => {
|
|
|
67
67
|
trigger,
|
|
68
68
|
spacing,
|
|
69
69
|
shouldFlip = true,
|
|
70
|
+
shouldRenderToParent = false,
|
|
70
71
|
isLoading = false,
|
|
71
72
|
autoFocus = false,
|
|
72
73
|
testId,
|
|
@@ -159,7 +160,7 @@ const DropdownMenu = props => {
|
|
|
159
160
|
fallbackPlacements: fallbackPlacements,
|
|
160
161
|
testId: testId && `${testId}--content`,
|
|
161
162
|
shouldUseCaptureOnOutsideClick: true,
|
|
162
|
-
shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ?
|
|
163
|
+
shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
|
|
163
164
|
trigger: triggerProps => {
|
|
164
165
|
if (typeof trigger === 'function') {
|
|
165
166
|
const {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SVGIcon from '@atlaskit/icon/svg';
|
|
3
|
-
import {
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { B400, N10, N100, N40 } from '@atlaskit/theme/colors';
|
|
4
5
|
/**
|
|
5
6
|
* __Checkbox icon__
|
|
6
7
|
*
|
|
@@ -25,8 +26,8 @@ const CheckboxIcon = ({
|
|
|
25
26
|
width: "12",
|
|
26
27
|
height: "12",
|
|
27
28
|
rx: "2",
|
|
28
|
-
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${N40})`,
|
|
29
|
-
strokeWidth: 2
|
|
29
|
+
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40})`,
|
|
30
|
+
strokeWidth: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
30
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
31
32
|
d: "M9.707 11.293a1 1 0 10-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 10-1.414-1.414L11 12.586l-1.293-1.293z",
|
|
32
33
|
fill: "inherit"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SVGIcon from '@atlaskit/icon/svg';
|
|
3
|
-
import {
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { B400, N10, N100, N40 } from '@atlaskit/theme/colors';
|
|
4
5
|
/**
|
|
5
6
|
* __Radio icon__
|
|
6
7
|
*
|
|
@@ -23,8 +24,8 @@ const RadioIcon = ({
|
|
|
23
24
|
cx: "12",
|
|
24
25
|
cy: "12",
|
|
25
26
|
r: "6",
|
|
26
|
-
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${N40})`,
|
|
27
|
-
strokeWidth: 2
|
|
27
|
+
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40})`,
|
|
28
|
+
strokeWidth: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
28
29
|
}), /*#__PURE__*/React.createElement("circle", {
|
|
29
30
|
fill: "inherit",
|
|
30
31
|
cx: "12",
|
|
@@ -76,6 +76,8 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
76
76
|
spacing = props.spacing,
|
|
77
77
|
_props$shouldFlip = props.shouldFlip,
|
|
78
78
|
shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip,
|
|
79
|
+
_props$shouldRenderTo = props.shouldRenderToParent,
|
|
80
|
+
shouldRenderToParent = _props$shouldRenderTo === void 0 ? false : _props$shouldRenderTo,
|
|
79
81
|
_props$isLoading = props.isLoading,
|
|
80
82
|
isLoading = _props$isLoading === void 0 ? false : _props$isLoading,
|
|
81
83
|
_props$autoFocus = props.autoFocus,
|
|
@@ -177,7 +179,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
177
179
|
fallbackPlacements: fallbackPlacements,
|
|
178
180
|
testId: testId && "".concat(testId, "--content"),
|
|
179
181
|
shouldUseCaptureOnOutsideClick: true,
|
|
180
|
-
shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ?
|
|
182
|
+
shouldRenderToParent: getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent : undefined,
|
|
181
183
|
trigger: function trigger(triggerProps) {
|
|
182
184
|
if (typeof _trigger === 'function') {
|
|
183
185
|
var ref = triggerProps.ref,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SVGIcon from '@atlaskit/icon/svg';
|
|
3
|
-
import {
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { B400, N10, N100, N40 } from '@atlaskit/theme/colors';
|
|
4
5
|
/**
|
|
5
6
|
* __Checkbox icon__
|
|
6
7
|
*
|
|
@@ -24,8 +25,8 @@ var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
|
24
25
|
width: "12",
|
|
25
26
|
height: "12",
|
|
26
27
|
rx: "2",
|
|
27
|
-
stroke: checked ? "var(--ds-border-selected, ".concat(B400, ")") : "var(--ds-border-input, ".concat(N40, ")"),
|
|
28
|
-
strokeWidth: 2
|
|
28
|
+
stroke: checked ? "var(--ds-border-selected, ".concat(B400, ")") : "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40, ")"),
|
|
29
|
+
strokeWidth: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
29
30
|
}), /*#__PURE__*/React.createElement("path", {
|
|
30
31
|
d: "M9.707 11.293a1 1 0 10-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 10-1.414-1.414L11 12.586l-1.293-1.293z",
|
|
31
32
|
fill: "inherit"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SVGIcon from '@atlaskit/icon/svg';
|
|
3
|
-
import {
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { B400, N10, N100, N40 } from '@atlaskit/theme/colors';
|
|
4
5
|
/**
|
|
5
6
|
* __Radio icon__
|
|
6
7
|
*
|
|
@@ -22,8 +23,8 @@ var RadioIcon = function RadioIcon(_ref) {
|
|
|
22
23
|
cx: "12",
|
|
23
24
|
cy: "12",
|
|
24
25
|
r: "6",
|
|
25
|
-
stroke: checked ? "var(--ds-border-selected, ".concat(B400, ")") : "var(--ds-border-input, ".concat(N40, ")"),
|
|
26
|
-
strokeWidth: 2
|
|
26
|
+
stroke: checked ? "var(--ds-border-selected, ".concat(B400, ")") : "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40, ")"),
|
|
27
|
+
strokeWidth: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? 1 : 2
|
|
27
28
|
}), /*#__PURE__*/React.createElement("circle", {
|
|
28
29
|
fill: "inherit",
|
|
29
30
|
cx: "12",
|
package/dist/types/types.d.ts
CHANGED
|
@@ -92,6 +92,12 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
|
|
|
92
92
|
* fit in the viewport.
|
|
93
93
|
*/
|
|
94
94
|
shouldFlip?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The root element where the DropdownMenu content should be rendered.
|
|
97
|
+
* `true` - rendering in the DOM node closest to the trigger. `false` - rendering in React.Portal.
|
|
98
|
+
* Defaults to `false`.
|
|
99
|
+
*/
|
|
100
|
+
shouldRenderToParent?: boolean;
|
|
95
101
|
/**
|
|
96
102
|
* Controls the spacing density of the menu.
|
|
97
103
|
*/
|
|
@@ -92,6 +92,12 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
|
|
|
92
92
|
* fit in the viewport.
|
|
93
93
|
*/
|
|
94
94
|
shouldFlip?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The root element where the DropdownMenu content should be rendered.
|
|
97
|
+
* `true` - rendering in the DOM node closest to the trigger. `false` - rendering in React.Portal.
|
|
98
|
+
* Defaults to `false`.
|
|
99
|
+
*/
|
|
100
|
+
shouldRenderToParent?: boolean;
|
|
95
101
|
/**
|
|
96
102
|
* Controls the spacing density of the menu.
|
|
97
103
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.12.0",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/button": "^16.
|
|
34
|
+
"@atlaskit/button": "^16.9.0",
|
|
35
35
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
36
36
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
37
|
"@atlaskit/icon": "^21.12.0",
|
|
38
|
-
"@atlaskit/menu": "^1.
|
|
38
|
+
"@atlaskit/menu": "^1.10.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
40
40
|
"@atlaskit/popup": "^1.9.0",
|
|
41
|
-
"@atlaskit/primitives": "^1.0
|
|
41
|
+
"@atlaskit/primitives": "^1.2.0",
|
|
42
42
|
"@atlaskit/spinner": "^15.5.0",
|
|
43
43
|
"@atlaskit/theme": "^12.5.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.17.0",
|
|
45
45
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@testing-library/dom": "^8.17.1",
|
|
61
61
|
"@testing-library/react": "^12.1.5",
|
|
62
62
|
"@testing-library/react-hooks": "^8.0.1",
|
|
63
|
+
"jest-in-case": "^1.0.2",
|
|
63
64
|
"jscodeshift": "^0.13.0",
|
|
64
65
|
"raf-stub": "^2.0.1",
|
|
65
66
|
"react-dom": "^16.8.0",
|
|
@@ -105,6 +106,9 @@
|
|
|
105
106
|
},
|
|
106
107
|
"platform.design-system-team.render-popup-in-parent_f73ij": {
|
|
107
108
|
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"platform.design-system-team.border-checkbox_nyoiu": {
|
|
111
|
+
"type": "boolean"
|
|
108
112
|
}
|
|
109
113
|
},
|
|
110
114
|
"homepage": "https://atlassian.design/components/dropdown-menu/",
|
package/report.api.md
CHANGED
|
@@ -147,6 +147,7 @@ export interface DropdownMenuProps<
|
|
|
147
147
|
onOpenChange?: (args: OnOpenChangeArgs) => void;
|
|
148
148
|
placement?: Placement;
|
|
149
149
|
shouldFlip?: boolean;
|
|
150
|
+
shouldRenderToParent?: boolean;
|
|
150
151
|
spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
|
|
151
152
|
statusLabel?: string;
|
|
152
153
|
testId?: string;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
|
|
|
123
123
|
onOpenChange?: (args: OnOpenChangeArgs) => void;
|
|
124
124
|
placement?: Placement;
|
|
125
125
|
shouldFlip?: boolean;
|
|
126
|
+
shouldRenderToParent?: boolean;
|
|
126
127
|
spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
|
|
127
128
|
statusLabel?: string;
|
|
128
129
|
testId?: string;
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED