@atlaskit/dropdown-menu 16.7.0 → 16.7.2
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 +13 -0
- package/dist/cjs/internal/hooks/use-radio-state.js +2 -2
- package/dist/cjs/radio/dropdown-item-radio-group.js +3 -13
- package/dist/cjs/radio/radio-group-context.js +18 -0
- package/dist/es2019/internal/hooks/use-radio-state.js +1 -1
- package/dist/es2019/radio/dropdown-item-radio-group.js +2 -12
- package/dist/es2019/radio/radio-group-context.js +11 -0
- package/dist/esm/internal/hooks/use-radio-state.js +1 -1
- package/dist/esm/radio/dropdown-item-radio-group.js +2 -12
- package/dist/esm/radio/radio-group-context.js +11 -0
- package/dist/types/radio/dropdown-item-radio-group.d.ts +0 -12
- package/dist/types/radio/radio-group-context.d.ts +14 -0
- package/dist/types-ts4.5/radio/dropdown-item-radio-group.d.ts +0 -12
- package/dist/types-ts4.5/radio/radio-group-context.d.ts +14 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 16.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f31216f23df61`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f31216f23df61) -
|
|
8
|
+
Removes internally exported API from files which will soon be exported as top-level API
|
|
9
|
+
|
|
10
|
+
## 16.7.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 16.7.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var
|
|
11
|
+
var _radioGroupContext = require("../../radio/radio-group-context");
|
|
12
12
|
var _selectionStore = require("../context/selection-store");
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -19,7 +19,7 @@ function useRadioState(_ref) {
|
|
|
19
19
|
var _useContext = (0, _react.useContext)(_selectionStore.SelectionStoreContext),
|
|
20
20
|
setGroupState = _useContext.setGroupState,
|
|
21
21
|
getGroupState = _useContext.getGroupState;
|
|
22
|
-
var _useContext2 = (0, _react.useContext)(
|
|
22
|
+
var _useContext2 = (0, _react.useContext)(_radioGroupContext.RadioGroupContext),
|
|
23
23
|
group = _useContext2.id,
|
|
24
24
|
radioGroupState = _useContext2.radioGroupState,
|
|
25
25
|
selectRadioItem = _useContext2.selectRadioItem;
|
|
@@ -5,32 +5,22 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
14
|
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
16
15
|
var _menu = require("@atlaskit/menu");
|
|
17
16
|
var _groupTitle = _interopRequireDefault(require("../internal/components/group-title"));
|
|
18
17
|
var _selectionStore = require("../internal/context/selection-store");
|
|
19
18
|
var _resetOptionsInGroup = _interopRequireDefault(require("../internal/utils/reset-options-in-group"));
|
|
19
|
+
var _radioGroupContext = require("./radio-group-context");
|
|
20
20
|
var _excluded = ["children", "hasSeparator", "id", "isList", "isScrollable", "testId", "title"];
|
|
21
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
22
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
-
/**
|
|
25
|
-
* __Radio group context__
|
|
26
|
-
* Context provider that wraps each DropdownItemRadioGroup
|
|
27
|
-
*/
|
|
28
|
-
var RadioGroupContext = exports.RadioGroupContext = /*#__PURE__*/(0, _react.createContext)({
|
|
29
|
-
id: '',
|
|
30
|
-
radioGroupState: {},
|
|
31
|
-
selectRadioItem: _noop.default
|
|
32
|
-
});
|
|
33
|
-
|
|
34
24
|
/**
|
|
35
25
|
* __Dropdown item radio group__
|
|
36
26
|
* Store which manages the selection state for each DropdownItemRadio
|
|
@@ -67,7 +57,7 @@ var DropdownItemRadioGroup = function DropdownItemRadioGroup(_ref) {
|
|
|
67
57
|
setRadioGroupState(newValue);
|
|
68
58
|
setGroupState(id, newValue);
|
|
69
59
|
};
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(RadioGroupContext.Provider, {
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_radioGroupContext.RadioGroupContext.Provider, {
|
|
71
61
|
value: {
|
|
72
62
|
id: id,
|
|
73
63
|
radioGroupState: radioGroupState,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RadioGroupContext = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
10
|
+
/**
|
|
11
|
+
* __Radio group context__
|
|
12
|
+
* Context provider that wraps each DropdownItemRadioGroup
|
|
13
|
+
*/
|
|
14
|
+
var RadioGroupContext = exports.RadioGroupContext = /*#__PURE__*/(0, _react.createContext)({
|
|
15
|
+
id: '',
|
|
16
|
+
radioGroupState: {},
|
|
17
|
+
selectRadioItem: _noop.default
|
|
18
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
2
|
-
import { RadioGroupContext } from '../../radio/
|
|
2
|
+
import { RadioGroupContext } from '../../radio/radio-group-context';
|
|
3
3
|
import { SelectionStoreContext } from '../context/selection-store';
|
|
4
4
|
function useRadioState({
|
|
5
5
|
id,
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, {
|
|
3
|
-
import noop from '@atlaskit/ds-lib/noop';
|
|
2
|
+
import React, { useContext, useState } from 'react';
|
|
4
3
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
5
4
|
import { Section } from '@atlaskit/menu';
|
|
6
5
|
import GroupTitle from '../internal/components/group-title';
|
|
7
6
|
import { SelectionStoreContext } from '../internal/context/selection-store';
|
|
8
7
|
import resetOptionsInGroup from '../internal/utils/reset-options-in-group';
|
|
9
|
-
|
|
10
|
-
* __Radio group context__
|
|
11
|
-
* Context provider that wraps each DropdownItemRadioGroup
|
|
12
|
-
*/
|
|
13
|
-
export const RadioGroupContext = /*#__PURE__*/createContext({
|
|
14
|
-
id: '',
|
|
15
|
-
radioGroupState: {},
|
|
16
|
-
selectRadioItem: noop
|
|
17
|
-
});
|
|
18
|
-
|
|
8
|
+
import { RadioGroupContext } from './radio-group-context';
|
|
19
9
|
/**
|
|
20
10
|
* __Dropdown item radio group__
|
|
21
11
|
* Store which manages the selection state for each DropdownItemRadio
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
3
|
+
/**
|
|
4
|
+
* __Radio group context__
|
|
5
|
+
* Context provider that wraps each DropdownItemRadioGroup
|
|
6
|
+
*/
|
|
7
|
+
export const RadioGroupContext = /*#__PURE__*/createContext({
|
|
8
|
+
id: '',
|
|
9
|
+
radioGroupState: {},
|
|
10
|
+
selectRadioItem: noop
|
|
11
|
+
});
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
6
|
-
import { RadioGroupContext } from '../../radio/
|
|
6
|
+
import { RadioGroupContext } from '../../radio/radio-group-context';
|
|
7
7
|
import { SelectionStoreContext } from '../context/selection-store';
|
|
8
8
|
function useRadioState(_ref) {
|
|
9
9
|
var id = _ref.id,
|
|
@@ -5,23 +5,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
var _excluded = ["children", "hasSeparator", "id", "isList", "isScrollable", "testId", "title"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
import React, {
|
|
9
|
-
import noop from '@atlaskit/ds-lib/noop';
|
|
8
|
+
import React, { useContext, useState } from 'react';
|
|
10
9
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
11
10
|
import { Section } from '@atlaskit/menu';
|
|
12
11
|
import GroupTitle from '../internal/components/group-title';
|
|
13
12
|
import { SelectionStoreContext } from '../internal/context/selection-store';
|
|
14
13
|
import resetOptionsInGroup from '../internal/utils/reset-options-in-group';
|
|
15
|
-
|
|
16
|
-
* __Radio group context__
|
|
17
|
-
* Context provider that wraps each DropdownItemRadioGroup
|
|
18
|
-
*/
|
|
19
|
-
export var RadioGroupContext = /*#__PURE__*/createContext({
|
|
20
|
-
id: '',
|
|
21
|
-
radioGroupState: {},
|
|
22
|
-
selectRadioItem: noop
|
|
23
|
-
});
|
|
24
|
-
|
|
14
|
+
import { RadioGroupContext } from './radio-group-context';
|
|
25
15
|
/**
|
|
26
16
|
* __Dropdown item radio group__
|
|
27
17
|
* Store which manages the selection state for each DropdownItemRadio
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
3
|
+
/**
|
|
4
|
+
* __Radio group context__
|
|
5
|
+
* Context provider that wraps each DropdownItemRadioGroup
|
|
6
|
+
*/
|
|
7
|
+
export var RadioGroupContext = /*#__PURE__*/createContext({
|
|
8
|
+
id: '',
|
|
9
|
+
radioGroupState: {},
|
|
10
|
+
selectRadioItem: noop
|
|
11
|
+
});
|
|
@@ -3,18 +3,6 @@ import { type SectionProps } from '@atlaskit/menu';
|
|
|
3
3
|
interface DropdownItemRadioGroupProps extends SectionProps {
|
|
4
4
|
id: string;
|
|
5
5
|
}
|
|
6
|
-
interface RadioGroupContextProps {
|
|
7
|
-
id: string;
|
|
8
|
-
radioGroupState: {
|
|
9
|
-
[key: string]: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
selectRadioItem: (id: string, value: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* __Radio group context__
|
|
15
|
-
* Context provider that wraps each DropdownItemRadioGroup
|
|
16
|
-
*/
|
|
17
|
-
export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
|
|
18
6
|
/**
|
|
19
7
|
* __Dropdown item radio group__
|
|
20
8
|
* Store which manages the selection state for each DropdownItemRadio
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RadioGroupContextProps {
|
|
3
|
+
id: string;
|
|
4
|
+
radioGroupState: {
|
|
5
|
+
[key: string]: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
selectRadioItem: (id: string, value: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* __Radio group context__
|
|
11
|
+
* Context provider that wraps each DropdownItemRadioGroup
|
|
12
|
+
*/
|
|
13
|
+
export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
|
|
14
|
+
export {};
|
|
@@ -3,18 +3,6 @@ import { type SectionProps } from '@atlaskit/menu';
|
|
|
3
3
|
interface DropdownItemRadioGroupProps extends SectionProps {
|
|
4
4
|
id: string;
|
|
5
5
|
}
|
|
6
|
-
interface RadioGroupContextProps {
|
|
7
|
-
id: string;
|
|
8
|
-
radioGroupState: {
|
|
9
|
-
[key: string]: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
selectRadioItem: (id: string, value: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* __Radio group context__
|
|
15
|
-
* Context provider that wraps each DropdownItemRadioGroup
|
|
16
|
-
*/
|
|
17
|
-
export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
|
|
18
6
|
/**
|
|
19
7
|
* __Dropdown item radio group__
|
|
20
8
|
* Store which manages the selection state for each DropdownItemRadio
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RadioGroupContextProps {
|
|
3
|
+
id: string;
|
|
4
|
+
radioGroupState: {
|
|
5
|
+
[key: string]: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
selectRadioItem: (id: string, value: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* __Radio group context__
|
|
11
|
+
* Context provider that wraps each DropdownItemRadioGroup
|
|
12
|
+
*/
|
|
13
|
+
export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "16.7.
|
|
3
|
+
"version": "16.7.2",
|
|
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/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/button": "^23.10.0",
|
|
28
28
|
"@atlaskit/css": "^0.19.0",
|
|
29
29
|
"@atlaskit/ds-lib": "^6.0.0",
|
|
30
|
-
"@atlaskit/icon": "^
|
|
30
|
+
"@atlaskit/icon": "^33.0.0",
|
|
31
31
|
"@atlaskit/layering": "^3.6.0",
|
|
32
32
|
"@atlaskit/menu": "^8.4.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@af/visual-regression": "workspace:^",
|
|
51
51
|
"@atlaskit/app-provider": "^4.1.0",
|
|
52
52
|
"@atlaskit/atlassian-navigation": "^5.6.0",
|
|
53
|
-
"@atlaskit/avatar": "^25.
|
|
53
|
+
"@atlaskit/avatar": "^25.10.0",
|
|
54
54
|
"@atlaskit/checkbox": "^17.3.0",
|
|
55
55
|
"@atlaskit/docs": "^11.7.0",
|
|
56
56
|
"@atlaskit/form": "^15.4.0",
|