@primer/components 0.0.0-2021103011479 → 0.0.0-2021103011528
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 +4 -3
- package/lib/ActionList2/MenuContext.d.ts +0 -10
- package/lib/ActionList2/MenuContext.js +0 -15
- package/lib/ActionMenu2.d.ts +0 -309
- 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 -309
- package/lib-esm/ActionMenu2.js +0 -67
package/CHANGELOG.md
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
# @primer/components
|
2
2
|
|
3
|
-
## 0.0.0-
|
4
|
-
|
5
|
-
### Minor Changes
|
6
|
-
|
7
|
-
- [#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`
|
3
|
+
## 0.0.0-2021103011528
|
8
4
|
|
9
5
|
### Patch Changes
|
10
6
|
|
@@ -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 = () => null,
|
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)();
|
@@ -172,23 +164,16 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
172
164
|
|
173
165
|
const clickHandler = _react.default.useCallback(event => {
|
174
166
|
if (disabled) return;
|
175
|
-
|
176
|
-
|
177
|
-
onSelect(event); // if this Item is inside a Menu, close the Menu
|
178
|
-
|
179
|
-
if (typeof afterSelect === 'function') afterSelect();
|
180
|
-
}
|
181
|
-
}, [onSelect, disabled, afterSelect]);
|
167
|
+
if (!event.defaultPrevented) onSelect(event);
|
168
|
+
}, [onSelect, disabled]);
|
182
169
|
|
183
170
|
const keyPressHandler = _react.default.useCallback(event => {
|
184
171
|
if (disabled) return;
|
185
172
|
|
186
173
|
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
187
|
-
onSelect(event);
|
188
|
-
|
189
|
-
if (typeof afterSelect === 'function') afterSelect();
|
174
|
+
onSelect(event);
|
190
175
|
}
|
191
|
-
}, [onSelect, disabled
|
176
|
+
}, [onSelect, disabled]); // use props.id if provided, otherwise generate one.
|
192
177
|
|
193
178
|
|
194
179
|
const labelId = (0, _ssr.useSSRSafeId)(id);
|
@@ -211,8 +196,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef(({
|
|
211
196
|
"aria-disabled": disabled ? true : undefined,
|
212
197
|
tabIndex: disabled || _PrivateItemWrapper ? undefined : 0,
|
213
198
|
"aria-labelledby": `${labelId} ${slots.InlineDescription ? inlineDescriptionId : ''}`,
|
214
|
-
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
215
|
-
role: role || itemRole
|
199
|
+
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
216
200
|
}, props), /*#__PURE__*/_react.default.createElement(ItemWrapper, null, /*#__PURE__*/_react.default.createElement(_Selection.Selection, {
|
217
201
|
selected: selected
|
218
202
|
}), 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 = () => null,
|
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();
|
@@ -140,22 +134,15 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
140
134
|
};
|
141
135
|
const clickHandler = React.useCallback(event => {
|
142
136
|
if (disabled) return;
|
143
|
-
|
144
|
-
|
145
|
-
onSelect(event); // if this Item is inside a Menu, close the Menu
|
146
|
-
|
147
|
-
if (typeof afterSelect === 'function') afterSelect();
|
148
|
-
}
|
149
|
-
}, [onSelect, disabled, afterSelect]);
|
137
|
+
if (!event.defaultPrevented) onSelect(event);
|
138
|
+
}, [onSelect, disabled]);
|
150
139
|
const keyPressHandler = React.useCallback(event => {
|
151
140
|
if (disabled) return;
|
152
141
|
|
153
142
|
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
154
|
-
onSelect(event);
|
155
|
-
|
156
|
-
if (typeof afterSelect === 'function') afterSelect();
|
143
|
+
onSelect(event);
|
157
144
|
}
|
158
|
-
}, [onSelect, disabled
|
145
|
+
}, [onSelect, disabled]); // use props.id if provided, otherwise generate one.
|
159
146
|
|
160
147
|
const labelId = useSSRSafeId(id);
|
161
148
|
const inlineDescriptionId = useSSRSafeId(id && `${id}--inline-description`);
|
@@ -177,8 +164,7 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
177
164
|
"aria-disabled": disabled ? true : undefined,
|
178
165
|
tabIndex: disabled || _PrivateItemWrapper ? undefined : 0,
|
179
166
|
"aria-labelledby": `${labelId} ${slots.InlineDescription ? inlineDescriptionId : ''}`,
|
180
|
-
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
181
|
-
role: role || itemRole
|
167
|
+
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
182
168
|
}, props), /*#__PURE__*/React.createElement(ItemWrapper, null, /*#__PURE__*/React.createElement(Selection, {
|
183
169
|
selected: selected
|
184
170
|
}), 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,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/components",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-2021103011528",
|
4
4
|
"description": "Primer react components",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "lib-esm/index.js",
|
@@ -87,7 +87,7 @@
|
|
87
87
|
"@testing-library/user-event": "13.1.9",
|
88
88
|
"@types/chroma-js": "2.1.3",
|
89
89
|
"@types/enzyme": "3.10.9",
|
90
|
-
"@types/jest": "
|
90
|
+
"@types/jest": "27.0.2",
|
91
91
|
"@types/jest-axe": "3.5.3",
|
92
92
|
"@types/lodash.isempty": "4.4.6",
|
93
93
|
"@types/lodash.isobject": "3.0.6",
|
@@ -137,7 +137,8 @@
|
|
137
137
|
"storybook-addon-performance": "0.16.1",
|
138
138
|
"styled-components": "4.4.1",
|
139
139
|
"ts-toolbelt": "9.6.0",
|
140
|
-
"typescript": "4.2.2"
|
140
|
+
"typescript": "4.2.2",
|
141
|
+
"front-matter": "4.0.2"
|
141
142
|
},
|
142
143
|
"peerDependencies": {
|
143
144
|
"react": "^17.0.0",
|
@@ -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;
|