@primer/components 0.0.0-2021103018568 → 0.0.0-202110302224
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 +1 -5
- package/lib/ActionList2/Divider.d.ts +2 -3
- package/lib/ActionList2/Divider.js +5 -10
- package/lib/ActionList2/Item.js +5 -21
- package/lib/ActionList2/List.js +1 -11
- package/lib/ActionList2/Selection.js +0 -11
- package/lib/ActionList2/index.d.ts +2 -1
- package/lib/drafts.d.ts +0 -1
- package/lib/drafts.js +0 -13
- package/lib-esm/ActionList2/Divider.d.ts +2 -3
- package/lib-esm/ActionList2/Divider.js +5 -8
- package/lib-esm/ActionList2/Item.js +5 -19
- package/lib-esm/ActionList2/List.js +1 -9
- package/lib-esm/ActionList2/Selection.js +0 -9
- package/lib-esm/ActionList2/index.d.ts +2 -1
- package/lib-esm/drafts.d.ts +0 -1
- package/lib-esm/drafts.js +1 -2
- package/package.json +1 -1
- package/lib/ActionList2/MenuContext.d.ts +0 -10
- package/lib/ActionList2/MenuContext.js +0 -15
- package/lib/ActionMenu2.d.ts +0 -310
- package/lib/ActionMenu2.js +0 -91
- package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
- package/lib-esm/ActionList2/MenuContext.js +0 -3
- package/lib-esm/ActionMenu2.d.ts +0 -310
- package/lib-esm/ActionMenu2.js +0 -67
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# @primer/components
|
2
2
|
|
3
|
-
## 0.0.0-
|
3
|
+
## 0.0.0-202110302224
|
4
4
|
|
5
5
|
### Major Changes
|
6
6
|
|
@@ -12,10 +12,6 @@
|
|
12
12
|
|
13
13
|
* [#1643](https://github.com/primer/react/pull/1643) [`3938550f`](https://github.com/primer/react/commit/3938550fb3ea3fbec542a0cadaf6aeb734fba938) Thanks [@jfuchs](https://github.com/jfuchs)! - Heading no longer accepts styled-system props. Please use the `sx` prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information about `sx` and https://primer.style/react/system-props for context on the removal.
|
14
14
|
|
15
|
-
### Minor Changes
|
16
|
-
|
17
|
-
- [#1619](https://github.com/primer/react/pull/1619) [`38e45b33`](https://github.com/primer/react/commit/38e45b33c5efe70134d2459e39ddcfb66941957d) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Add composable `ActionMenu` to `@primer/components/drafts`
|
18
|
-
|
19
15
|
### Patch Changes
|
20
16
|
|
21
17
|
- [#1668](https://github.com/primer/react/pull/1668) [`98dc6336`](https://github.com/primer/react/commit/98dc633674b793edfa4fbeb88fd239e6ca40544e) Thanks [@siddharthkp](https://github.com/siddharthkp)! - ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
import { SxProp } from '../sx';
|
1
|
+
/// <reference types="react" />
|
3
2
|
/**
|
4
3
|
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
5
4
|
*/
|
6
|
-
export declare
|
5
|
+
export declare function Divider(): JSX.Element;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.Divider =
|
6
|
+
exports.Divider = Divider;
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
@@ -11,30 +11,25 @@ var _Box = _interopRequireDefault(require("../Box"));
|
|
11
11
|
|
12
12
|
var _constants = require("../constants");
|
13
13
|
|
14
|
-
var _sx = require("../sx");
|
15
|
-
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
15
|
|
18
16
|
/**
|
19
17
|
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
20
18
|
*/
|
21
|
-
|
22
|
-
sx = {}
|
23
|
-
}) => {
|
19
|
+
function Divider() {
|
24
20
|
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
25
21
|
as: "li",
|
26
22
|
role: "separator",
|
27
|
-
sx:
|
23
|
+
sx: {
|
28
24
|
height: 1,
|
29
25
|
backgroundColor: 'actionListItem.inlineDivider',
|
30
26
|
marginTop: theme => `calc(${(0, _constants.get)('space.2')(theme)} - 1px)`,
|
31
27
|
marginBottom: 2,
|
32
28
|
listStyle: 'none' // hide the ::marker inserted by browser's stylesheet
|
33
29
|
|
34
|
-
},
|
30
|
+
},
|
35
31
|
"data-component": "ActionList.Divider"
|
36
32
|
});
|
37
|
-
}
|
33
|
+
}
|
38
34
|
|
39
|
-
exports.Divider = Divider;
|
40
35
|
Divider.displayName = "Divider";
|
package/lib/ActionList2/Item.js
CHANGED
@@ -21,8 +21,6 @@ var _createSlots = _interopRequireDefault(require("../utils/create-slots"));
|
|
21
21
|
|
22
22
|
var _List = require("./List");
|
23
23
|
|
24
|
-
var _MenuContext = require("./MenuContext");
|
25
|
-
|
26
24
|
var _Selection = require("./Selection");
|
27
25
|
|
28
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -84,7 +82,6 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
84
82
|
onSelect,
|
85
83
|
sx: sxProp = {},
|
86
84
|
id,
|
87
|
-
role,
|
88
85
|
_PrivateItemWrapper,
|
89
86
|
...props
|
90
87
|
}, forwardedRef) => {
|
@@ -93,11 +90,6 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
93
90
|
showDividers
|
94
91
|
} = _react.default.useContext(_List.ListContext);
|
95
92
|
|
96
|
-
const {
|
97
|
-
itemRole,
|
98
|
-
afterSelect
|
99
|
-
} = _react.default.useContext(_MenuContext.MenuContext);
|
100
|
-
|
101
93
|
const {
|
102
94
|
theme
|
103
95
|
} = (0, _ThemeProvider.useTheme)();
|
@@ -173,24 +165,17 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
173
165
|
const clickHandler = _react.default.useCallback(event => {
|
174
166
|
if (typeof onSelect !== 'function') return;
|
175
167
|
if (disabled) return;
|
176
|
-
|
177
|
-
|
178
|
-
onSelect(event); // if this Item is inside a Menu, close the Menu
|
179
|
-
|
180
|
-
if (typeof afterSelect === 'function') afterSelect();
|
181
|
-
}
|
182
|
-
}, [onSelect, disabled, afterSelect]);
|
168
|
+
if (!event.defaultPrevented) onSelect(event);
|
169
|
+
}, [onSelect, disabled]);
|
183
170
|
|
184
171
|
const keyPressHandler = _react.default.useCallback(event => {
|
185
172
|
if (typeof onSelect !== 'function') return;
|
186
173
|
if (disabled) return;
|
187
174
|
|
188
175
|
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
189
|
-
onSelect(event);
|
190
|
-
|
191
|
-
if (typeof afterSelect === 'function') afterSelect();
|
176
|
+
onSelect(event);
|
192
177
|
}
|
193
|
-
}, [onSelect, disabled
|
178
|
+
}, [onSelect, disabled]); // use props.id if provided, otherwise generate one.
|
194
179
|
|
195
180
|
|
196
181
|
const labelId = (0, _ssr.useSSRSafeId)(id);
|
@@ -213,8 +198,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
213
198
|
"aria-disabled": disabled ? true : undefined,
|
214
199
|
tabIndex: disabled || _PrivateItemWrapper ? undefined : 0,
|
215
200
|
"aria-labelledby": `${labelId} ${slots.InlineDescription ? inlineDescriptionId : ''}`,
|
216
|
-
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
217
|
-
role: role || itemRole
|
201
|
+
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
218
202
|
}, props), /*#__PURE__*/_react.default.createElement(ItemWrapper, null, /*#__PURE__*/_react.default.createElement(_Selection.Selection, {
|
219
203
|
selected: selected
|
220
204
|
}), slots.LeadingVisual, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
package/lib/ActionList2/List.js
CHANGED
@@ -11,8 +11,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireWildcard(require("../sx"));
|
13
13
|
|
14
|
-
var _MenuContext = require("./MenuContext");
|
15
|
-
|
16
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
15
|
|
18
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -34,7 +32,6 @@ const List = /*#__PURE__*/_react.default.forwardRef(({
|
|
34
32
|
variant = 'inset',
|
35
33
|
selectionVariant,
|
36
34
|
showDividers = false,
|
37
|
-
role,
|
38
35
|
sx: sxProp = {},
|
39
36
|
...props
|
40
37
|
}, forwardedRef) => {
|
@@ -44,15 +41,8 @@ const List = /*#__PURE__*/_react.default.forwardRef(({
|
|
44
41
|
// reset ul styles
|
45
42
|
paddingY: variant === 'inset' ? 2 : 0
|
46
43
|
};
|
47
|
-
/** if list is inside a Menu, it will get a role from the Menu */
|
48
|
-
|
49
|
-
const {
|
50
|
-
listRole
|
51
|
-
} = _react.default.useContext(_MenuContext.MenuContext);
|
52
|
-
|
53
44
|
return /*#__PURE__*/_react.default.createElement(ListBox, _extends({
|
54
|
-
sx: (0, _sx.merge)(styles, sxProp)
|
55
|
-
role: role || listRole
|
45
|
+
sx: (0, _sx.merge)(styles, sxProp)
|
56
46
|
}, props, {
|
57
47
|
ref: forwardedRef
|
58
48
|
}), /*#__PURE__*/_react.default.createElement(ListContext.Provider, {
|
@@ -13,8 +13,6 @@ var _List = require("./List");
|
|
13
13
|
|
14
14
|
var _Group = require("./Group");
|
15
15
|
|
16
|
-
var _MenuContext = require("./MenuContext");
|
17
|
-
|
18
16
|
var _Visuals = require("./Visuals");
|
19
17
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -29,10 +27,6 @@ const Selection = ({
|
|
29
27
|
const {
|
30
28
|
selectionVariant: groupSelectionVariant
|
31
29
|
} = _react.default.useContext(_Group.GroupContext);
|
32
|
-
|
33
|
-
const {
|
34
|
-
parent
|
35
|
-
} = _react.default.useContext(_MenuContext.MenuContext);
|
36
30
|
/** selectionVariant in Group can override the selectionVariant in List root */
|
37
31
|
|
38
32
|
|
@@ -44,11 +38,6 @@ const Selection = ({
|
|
44
38
|
return null;
|
45
39
|
}
|
46
40
|
|
47
|
-
if (parent === 'ActionMenu') {
|
48
|
-
throw new Error('ActionList cannot have a selectionVariant inside ActionMenu, please use DropdownMenu or SelectPanel instead. More information: https://primer.style/design/components/action-list#application');
|
49
|
-
return null;
|
50
|
-
}
|
51
|
-
|
52
41
|
if (selectionVariant === 'single') {
|
53
42
|
return /*#__PURE__*/_react.default.createElement(_Visuals.LeadingVisualContainer, null, selected && /*#__PURE__*/_react.default.createElement(_octiconsReact.CheckIcon, null));
|
54
43
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { Divider } from './Divider';
|
2
3
|
export type { ListProps as ActionListProps } from './List';
|
3
4
|
export type { GroupProps } from './Group';
|
4
5
|
export type { ItemProps } from './Item';
|
@@ -25,7 +26,7 @@ export declare const ActionList: import("@radix-ui/react-polymorphic").ForwardRe
|
|
25
26
|
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
26
27
|
}>;
|
27
28
|
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
28
|
-
Divider:
|
29
|
+
Divider: typeof Divider;
|
29
30
|
/** Secondary text which provides additional information about an `Item`. */
|
30
31
|
Description: import("react").FC<import("./Description").DescriptionProps>;
|
31
32
|
/** Icon (or similar) positioned before `Item` text. */
|
package/lib/drafts.d.ts
CHANGED
package/lib/drafts.js
CHANGED
@@ -28,17 +28,4 @@ Object.keys(_NewButton).forEach(function (key) {
|
|
28
28
|
return _NewButton[key];
|
29
29
|
}
|
30
30
|
});
|
31
|
-
});
|
32
|
-
|
33
|
-
var _ActionMenu = require("./ActionMenu2");
|
34
|
-
|
35
|
-
Object.keys(_ActionMenu).forEach(function (key) {
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
37
|
-
if (key in exports && exports[key] === _ActionMenu[key]) return;
|
38
|
-
Object.defineProperty(exports, key, {
|
39
|
-
enumerable: true,
|
40
|
-
get: function () {
|
41
|
-
return _ActionMenu[key];
|
42
|
-
}
|
43
|
-
});
|
44
31
|
});
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
import { SxProp } from '../sx';
|
1
|
+
/// <reference types="react" />
|
3
2
|
/**
|
4
3
|
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
5
4
|
*/
|
6
|
-
export declare
|
5
|
+
export declare function Divider(): JSX.Element;
|
@@ -1,26 +1,23 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import Box from '../Box';
|
3
3
|
import { get } from '../constants';
|
4
|
-
|
4
|
+
|
5
5
|
/**
|
6
6
|
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
7
7
|
*/
|
8
|
-
|
9
|
-
export const Divider = ({
|
10
|
-
sx = {}
|
11
|
-
}) => {
|
8
|
+
export function Divider() {
|
12
9
|
return /*#__PURE__*/React.createElement(Box, {
|
13
10
|
as: "li",
|
14
11
|
role: "separator",
|
15
|
-
sx:
|
12
|
+
sx: {
|
16
13
|
height: 1,
|
17
14
|
backgroundColor: 'actionListItem.inlineDivider',
|
18
15
|
marginTop: theme => `calc(${get('space.2')(theme)} - 1px)`,
|
19
16
|
marginBottom: 2,
|
20
17
|
listStyle: 'none' // hide the ::marker inserted by browser's stylesheet
|
21
18
|
|
22
|
-
},
|
19
|
+
},
|
23
20
|
"data-component": "ActionList.Divider"
|
24
21
|
});
|
25
|
-
}
|
22
|
+
}
|
26
23
|
Divider.displayName = "Divider";
|
@@ -8,7 +8,6 @@ import Box from '../Box';
|
|
8
8
|
import sx, { merge } from '../sx';
|
9
9
|
import createSlots from '../utils/create-slots';
|
10
10
|
import { ListContext } from './List';
|
11
|
-
import { MenuContext } from './MenuContext';
|
12
11
|
import { Selection } from './Selection';
|
13
12
|
export const getVariantStyles = (variant, disabled) => {
|
14
13
|
if (disabled) {
|
@@ -55,7 +54,6 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
55
54
|
onSelect,
|
56
55
|
sx: sxProp = {},
|
57
56
|
id,
|
58
|
-
role,
|
59
57
|
_PrivateItemWrapper,
|
60
58
|
...props
|
61
59
|
}, forwardedRef) => {
|
@@ -63,10 +61,6 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
63
61
|
variant: listVariant,
|
64
62
|
showDividers
|
65
63
|
} = React.useContext(ListContext);
|
66
|
-
const {
|
67
|
-
itemRole,
|
68
|
-
afterSelect
|
69
|
-
} = React.useContext(MenuContext);
|
70
64
|
const {
|
71
65
|
theme
|
72
66
|
} = useTheme();
|
@@ -141,23 +135,16 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
141
135
|
const clickHandler = React.useCallback(event => {
|
142
136
|
if (typeof onSelect !== 'function') return;
|
143
137
|
if (disabled) return;
|
144
|
-
|
145
|
-
|
146
|
-
onSelect(event); // if this Item is inside a Menu, close the Menu
|
147
|
-
|
148
|
-
if (typeof afterSelect === 'function') afterSelect();
|
149
|
-
}
|
150
|
-
}, [onSelect, disabled, afterSelect]);
|
138
|
+
if (!event.defaultPrevented) onSelect(event);
|
139
|
+
}, [onSelect, disabled]);
|
151
140
|
const keyPressHandler = React.useCallback(event => {
|
152
141
|
if (typeof onSelect !== 'function') return;
|
153
142
|
if (disabled) return;
|
154
143
|
|
155
144
|
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
156
|
-
onSelect(event);
|
157
|
-
|
158
|
-
if (typeof afterSelect === 'function') afterSelect();
|
145
|
+
onSelect(event);
|
159
146
|
}
|
160
|
-
}, [onSelect, disabled
|
147
|
+
}, [onSelect, disabled]); // use props.id if provided, otherwise generate one.
|
161
148
|
|
162
149
|
const labelId = useSSRSafeId(id);
|
163
150
|
const inlineDescriptionId = useSSRSafeId(id && `${id}--inline-description`);
|
@@ -179,8 +166,7 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
179
166
|
"aria-disabled": disabled ? true : undefined,
|
180
167
|
tabIndex: disabled || _PrivateItemWrapper ? undefined : 0,
|
181
168
|
"aria-labelledby": `${labelId} ${slots.InlineDescription ? inlineDescriptionId : ''}`,
|
182
|
-
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
183
|
-
role: role || itemRole
|
169
|
+
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
184
170
|
}, props), /*#__PURE__*/React.createElement(ItemWrapper, null, /*#__PURE__*/React.createElement(Selection, {
|
185
171
|
selected: selected
|
186
172
|
}), slots.LeadingVisual, /*#__PURE__*/React.createElement(Box, {
|
@@ -3,7 +3,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import sx, { merge } from '../sx';
|
6
|
-
import { MenuContext } from './MenuContext';
|
7
6
|
export const ListContext = /*#__PURE__*/React.createContext({});
|
8
7
|
const ListBox = styled.ul.withConfig({
|
9
8
|
displayName: "List__ListBox",
|
@@ -13,7 +12,6 @@ export const List = /*#__PURE__*/React.forwardRef(({
|
|
13
12
|
variant = 'inset',
|
14
13
|
selectionVariant,
|
15
14
|
showDividers = false,
|
16
|
-
role,
|
17
15
|
sx: sxProp = {},
|
18
16
|
...props
|
19
17
|
}, forwardedRef) => {
|
@@ -23,14 +21,8 @@ export const List = /*#__PURE__*/React.forwardRef(({
|
|
23
21
|
// reset ul styles
|
24
22
|
paddingY: variant === 'inset' ? 2 : 0
|
25
23
|
};
|
26
|
-
/** if list is inside a Menu, it will get a role from the Menu */
|
27
|
-
|
28
|
-
const {
|
29
|
-
listRole
|
30
|
-
} = React.useContext(MenuContext);
|
31
24
|
return /*#__PURE__*/React.createElement(ListBox, _extends({
|
32
|
-
sx: merge(styles, sxProp)
|
33
|
-
role: role || listRole
|
25
|
+
sx: merge(styles, sxProp)
|
34
26
|
}, props, {
|
35
27
|
ref: forwardedRef
|
36
28
|
}), /*#__PURE__*/React.createElement(ListContext.Provider, {
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
2
2
|
import { CheckIcon } from '@primer/octicons-react';
|
3
3
|
import { ListContext } from './List';
|
4
4
|
import { GroupContext } from './Group';
|
5
|
-
import { MenuContext } from './MenuContext';
|
6
5
|
import { LeadingVisualContainer } from './Visuals';
|
7
6
|
export const Selection = ({
|
8
7
|
selected
|
@@ -13,9 +12,6 @@ export const Selection = ({
|
|
13
12
|
const {
|
14
13
|
selectionVariant: groupSelectionVariant
|
15
14
|
} = React.useContext(GroupContext);
|
16
|
-
const {
|
17
|
-
parent
|
18
|
-
} = React.useContext(MenuContext);
|
19
15
|
/** selectionVariant in Group can override the selectionVariant in List root */
|
20
16
|
|
21
17
|
const selectionVariant = typeof groupSelectionVariant !== 'undefined' ? groupSelectionVariant : listSelectionVariant; // if selectionVariant is not set on List, don't show selection
|
@@ -26,11 +22,6 @@ export const Selection = ({
|
|
26
22
|
return null;
|
27
23
|
}
|
28
24
|
|
29
|
-
if (parent === 'ActionMenu') {
|
30
|
-
throw new Error('ActionList cannot have a selectionVariant inside ActionMenu, please use DropdownMenu or SelectPanel instead. More information: https://primer.style/design/components/action-list#application');
|
31
|
-
return null;
|
32
|
-
}
|
33
|
-
|
34
25
|
if (selectionVariant === 'single') {
|
35
26
|
return /*#__PURE__*/React.createElement(LeadingVisualContainer, null, selected && /*#__PURE__*/React.createElement(CheckIcon, null));
|
36
27
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { Divider } from './Divider';
|
2
3
|
export type { ListProps as ActionListProps } from './List';
|
3
4
|
export type { GroupProps } from './Group';
|
4
5
|
export type { ItemProps } from './Item';
|
@@ -25,7 +26,7 @@ export declare const ActionList: import("@radix-ui/react-polymorphic").ForwardRe
|
|
25
26
|
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
26
27
|
}>;
|
27
28
|
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
28
|
-
Divider:
|
29
|
+
Divider: typeof Divider;
|
29
30
|
/** Secondary text which provides additional information about an `Item`. */
|
30
31
|
Description: import("react").FC<import("./Description").DescriptionProps>;
|
31
32
|
/** Icon (or similar) positioned before `Item` text. */
|
package/lib-esm/drafts.d.ts
CHANGED
package/lib-esm/drafts.js
CHANGED
package/package.json
CHANGED
@@ -1,10 +0,0 @@
|
|
1
|
-
/** This context can be used by components that compose ActionList inside a Menu */
|
2
|
-
import React from 'react';
|
3
|
-
declare type ContextProps = {
|
4
|
-
parent?: string;
|
5
|
-
listRole?: string;
|
6
|
-
itemRole?: string;
|
7
|
-
afterSelect?: () => void;
|
8
|
-
};
|
9
|
-
export declare const MenuContext: React.Context<ContextProps>;
|
10
|
-
export {};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.MenuContext = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
-
|
12
|
-
/** This context can be used by components that compose ActionList inside a Menu */
|
13
|
-
const MenuContext = /*#__PURE__*/_react.default.createContext({});
|
14
|
-
|
15
|
-
exports.MenuContext = MenuContext;
|