@primer/components 32.1.1-rc.92743105 → 33.0.0-rc.9cc2a259
Sign up to get free protection for your applications and to get access to all the features.
- package/.devcontainer/devcontainer.json +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/release_canary.yml +1 -1
- package/.github/workflows/release_candidate.yml +1 -1
- package/.github/workflows/statuses.yml +32 -0
- package/.gitignore +1 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +20 -2
- package/contributor-docs/CONTRIBUTING.md +14 -58
- package/dist/browser.esm.js +105 -108
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +105 -108
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/BranchName.md +6 -5
- package/docs/content/Details.md +4 -8
- package/docs/content/Heading.md +5 -10
- package/docs/content/Label.md +6 -7
- package/docs/content/ProgressBar.mdx +7 -6
- package/docs/content/Text.md +0 -6
- package/docs/content/{ActionList2.mdx → drafts/ActionList2.mdx} +5 -9
- package/docs/content/drafts/ActionMenu2.mdx +251 -0
- package/docs/content/status.mdx +1 -1
- package/docs/content/system-props.mdx +1 -1
- package/docs/src/@primer/gatsby-theme-doctocat/live-code-scope.js +9 -1
- package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +1 -1
- package/docs/src/component-checklist.js +10 -2
- package/lib/ActionList/Item.js +1 -1
- package/lib/ActionList2/Divider.d.ts +3 -2
- package/lib/ActionList2/Divider.js +10 -5
- package/lib/ActionList2/Item.js +21 -5
- package/lib/ActionList2/List.js +11 -1
- package/lib/ActionList2/MenuContext.d.ts +10 -0
- package/lib/ActionList2/MenuContext.js +15 -0
- package/lib/ActionList2/Selection.js +14 -1
- package/lib/ActionList2/index.d.ts +1 -2
- package/lib/ActionMenu2.d.ts +313 -0
- package/lib/ActionMenu2.js +91 -0
- package/lib/Autocomplete/Autocomplete.d.ts +2 -1
- package/lib/Autocomplete/AutocompleteInput.d.ts +2 -1
- package/lib/Avatar.d.ts +1 -2
- package/lib/Avatar.js +1 -1
- package/lib/BranchName.d.ts +1 -2
- package/lib/BranchName.js +1 -1
- package/lib/Button/Button.d.ts +2 -2
- package/lib/Button/ButtonClose.d.ts +2 -2
- package/lib/Button/ButtonDanger.d.ts +2 -2
- package/lib/Button/ButtonInvisible.d.ts +2 -2
- package/lib/Button/ButtonOutline.d.ts +2 -2
- package/lib/Button/ButtonPrimary.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +35 -35
- package/lib/Details.d.ts +1 -2
- package/lib/Details.js +1 -3
- package/lib/Dialog.d.ts +37 -37
- package/lib/Dropdown.d.ts +8 -72
- package/lib/DropdownMenu/DropdownButton.d.ts +6 -3
- package/lib/FilterList.d.ts +1 -1
- package/lib/Heading.d.ts +1 -2
- package/lib/Heading.js +1 -6
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.d.ts +16 -11
- package/lib/ProgressBar.js +6 -10
- package/lib/SelectMenu/SelectMenu.d.ts +11 -10
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/Spinner.d.ts +1 -2
- package/lib/Spinner.js +1 -3
- package/lib/TextInputWithTokens.d.ts +2 -1
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/__tests__/Avatar.test.js +4 -2
- package/lib/__tests__/Avatar.types.test.d.ts +3 -0
- package/lib/__tests__/Avatar.types.test.js +31 -0
- package/lib/__tests__/BranchName.types.test.d.ts +3 -0
- package/lib/__tests__/BranchName.types.test.js +28 -0
- package/lib/__tests__/Details.types.test.d.ts +3 -0
- package/lib/__tests__/Details.types.test.js +28 -0
- package/lib/__tests__/Heading.test.js +63 -30
- package/lib/__tests__/Heading.types.test.d.ts +3 -0
- package/lib/__tests__/Heading.types.test.js +28 -0
- package/lib/drafts.d.ts +1 -0
- package/lib/drafts.js +13 -0
- package/lib/stories/ActionMenu2.stories.js +433 -0
- package/lib-esm/ActionList/Item.js +1 -1
- package/lib-esm/ActionList2/Divider.d.ts +3 -2
- package/lib-esm/ActionList2/Divider.js +8 -5
- package/lib-esm/ActionList2/Item.js +19 -5
- package/lib-esm/ActionList2/List.js +9 -1
- package/lib-esm/ActionList2/MenuContext.d.ts +10 -0
- package/lib-esm/ActionList2/MenuContext.js +3 -0
- package/lib-esm/ActionList2/Selection.js +12 -1
- package/lib-esm/ActionList2/index.d.ts +1 -2
- package/lib-esm/ActionMenu2.d.ts +313 -0
- package/lib-esm/ActionMenu2.js +67 -0
- package/lib-esm/Autocomplete/Autocomplete.d.ts +2 -1
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +2 -1
- package/lib-esm/Avatar.d.ts +1 -2
- package/lib-esm/Avatar.js +2 -2
- package/lib-esm/BranchName.d.ts +1 -2
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Button/Button.d.ts +2 -2
- package/lib-esm/Button/ButtonClose.d.ts +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +35 -35
- package/lib-esm/Details.d.ts +1 -2
- package/lib-esm/Details.js +1 -2
- package/lib-esm/Dialog.d.ts +37 -37
- package/lib-esm/Dropdown.d.ts +8 -72
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +6 -3
- package/lib-esm/FilterList.d.ts +1 -1
- package/lib-esm/Heading.d.ts +1 -2
- package/lib-esm/Heading.js +2 -6
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.d.ts +16 -11
- package/lib-esm/ProgressBar.js +7 -11
- package/lib-esm/SelectMenu/SelectMenu.d.ts +11 -10
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/Spinner.d.ts +1 -2
- package/lib-esm/Spinner.js +1 -2
- package/lib-esm/TextInputWithTokens.d.ts +2 -1
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/__tests__/Avatar.test.js +4 -2
- package/lib-esm/__tests__/Avatar.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Avatar.types.test.js +16 -0
- package/lib-esm/__tests__/BranchName.types.test.d.ts +3 -0
- package/lib-esm/__tests__/BranchName.types.test.js +13 -0
- package/lib-esm/__tests__/Details.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Details.types.test.js +13 -0
- package/lib-esm/__tests__/Heading.test.js +62 -30
- package/lib-esm/__tests__/Heading.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Heading.types.test.js +13 -0
- package/lib-esm/drafts.d.ts +1 -0
- package/lib-esm/drafts.js +2 -1
- package/lib-esm/stories/ActionMenu2.stories.js +376 -0
- package/package-lock.json +321 -269
- package/package.json +11 -5
- package/script/component-status-project/build.ts +100 -0
- package/script/component-status-project/deploy.rb +142 -0
- package/src/ActionList/Item.tsx +1 -0
- package/src/ActionList2/Divider.tsx +13 -8
- package/src/ActionList2/Item.tsx +13 -3
- package/src/ActionList2/List.tsx +6 -2
- package/src/ActionList2/MenuContext.tsx +6 -0
- package/src/ActionList2/Selection.tsx +11 -1
- package/src/ActionMenu2.tsx +94 -0
- package/src/Avatar.tsx +2 -4
- package/src/BranchName.tsx +3 -3
- package/src/Details.tsx +1 -5
- package/src/Heading.tsx +2 -9
- package/src/ProgressBar.tsx +11 -10
- package/src/Spinner.tsx +1 -3
- package/src/__tests__/Avatar.test.tsx +1 -1
- package/src/__tests__/Avatar.types.test.tsx +11 -0
- package/src/__tests__/BranchName.types.test.tsx +11 -0
- package/src/__tests__/Details.types.test.tsx +11 -0
- package/src/__tests__/Heading.test.tsx +71 -25
- package/src/__tests__/Heading.types.test.tsx +11 -0
- package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +4 -0
- package/src/drafts.ts +1 -0
- package/src/stories/ActionMenu2.stories.tsx +551 -0
- package/stats.html +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +1 -1
@@ -1,23 +1,26 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import Box from '../Box';
|
3
3
|
import { get } from '../constants';
|
4
|
-
|
4
|
+
import { merge } from '../sx';
|
5
5
|
/**
|
6
6
|
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
7
7
|
*/
|
8
|
-
|
8
|
+
|
9
|
+
export const Divider = ({
|
10
|
+
sx = {}
|
11
|
+
}) => {
|
9
12
|
return /*#__PURE__*/React.createElement(Box, {
|
10
13
|
as: "li",
|
11
14
|
role: "separator",
|
12
|
-
sx: {
|
15
|
+
sx: merge({
|
13
16
|
height: 1,
|
14
17
|
backgroundColor: 'actionListItem.inlineDivider',
|
15
18
|
marginTop: theme => `calc(${get('space.2')(theme)} - 1px)`,
|
16
19
|
marginBottom: 2,
|
17
20
|
listStyle: 'none' // hide the ::marker inserted by browser's stylesheet
|
18
21
|
|
19
|
-
},
|
22
|
+
}, sx),
|
20
23
|
"data-component": "ActionList.Divider"
|
21
24
|
});
|
22
|
-
}
|
25
|
+
};
|
23
26
|
Divider.displayName = "Divider";
|
@@ -8,6 +8,7 @@ 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';
|
11
12
|
import { Selection } from './Selection';
|
12
13
|
export const getVariantStyles = (variant, disabled) => {
|
13
14
|
if (disabled) {
|
@@ -54,6 +55,7 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
54
55
|
onSelect,
|
55
56
|
sx: sxProp = {},
|
56
57
|
id,
|
58
|
+
role,
|
57
59
|
_PrivateItemWrapper,
|
58
60
|
...props
|
59
61
|
}, forwardedRef) => {
|
@@ -61,6 +63,10 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
61
63
|
variant: listVariant,
|
62
64
|
showDividers
|
63
65
|
} = React.useContext(ListContext);
|
66
|
+
const {
|
67
|
+
itemRole,
|
68
|
+
afterSelect
|
69
|
+
} = React.useContext(MenuContext);
|
64
70
|
const {
|
65
71
|
theme
|
66
72
|
} = useTheme();
|
@@ -135,16 +141,23 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
135
141
|
const clickHandler = React.useCallback(event => {
|
136
142
|
if (typeof onSelect !== 'function') return;
|
137
143
|
if (disabled) return;
|
138
|
-
|
139
|
-
|
144
|
+
|
145
|
+
if (!event.defaultPrevented) {
|
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]);
|
140
151
|
const keyPressHandler = React.useCallback(event => {
|
141
152
|
if (typeof onSelect !== 'function') return;
|
142
153
|
if (disabled) return;
|
143
154
|
|
144
155
|
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
145
|
-
onSelect(event);
|
156
|
+
onSelect(event); // if this Item is inside a Menu, close the Menu
|
157
|
+
|
158
|
+
if (typeof afterSelect === 'function') afterSelect();
|
146
159
|
}
|
147
|
-
}, [onSelect, disabled]); // use props.id if provided, otherwise generate one.
|
160
|
+
}, [onSelect, disabled, afterSelect]); // use props.id if provided, otherwise generate one.
|
148
161
|
|
149
162
|
const labelId = useSSRSafeId(id);
|
150
163
|
const inlineDescriptionId = useSSRSafeId(id && `${id}--inline-description`);
|
@@ -166,7 +179,8 @@ export const Item = /*#__PURE__*/React.forwardRef(({
|
|
166
179
|
"aria-disabled": disabled ? true : undefined,
|
167
180
|
tabIndex: disabled || _PrivateItemWrapper ? undefined : 0,
|
168
181
|
"aria-labelledby": `${labelId} ${slots.InlineDescription ? inlineDescriptionId : ''}`,
|
169
|
-
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined
|
182
|
+
"aria-describedby": slots.BlockDescription ? blockDescriptionId : undefined,
|
183
|
+
role: role || itemRole
|
170
184
|
}, props), /*#__PURE__*/React.createElement(ItemWrapper, null, /*#__PURE__*/React.createElement(Selection, {
|
171
185
|
selected: selected
|
172
186
|
}), slots.LeadingVisual, /*#__PURE__*/React.createElement(Box, {
|
@@ -3,6 +3,7 @@ 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';
|
6
7
|
export const ListContext = /*#__PURE__*/React.createContext({});
|
7
8
|
const ListBox = styled.ul.withConfig({
|
8
9
|
displayName: "List__ListBox",
|
@@ -12,6 +13,7 @@ export const List = /*#__PURE__*/React.forwardRef(({
|
|
12
13
|
variant = 'inset',
|
13
14
|
selectionVariant,
|
14
15
|
showDividers = false,
|
16
|
+
role,
|
15
17
|
sx: sxProp = {},
|
16
18
|
...props
|
17
19
|
}, forwardedRef) => {
|
@@ -21,8 +23,14 @@ export const List = /*#__PURE__*/React.forwardRef(({
|
|
21
23
|
// reset ul styles
|
22
24
|
paddingY: variant === 'inset' ? 2 : 0
|
23
25
|
};
|
26
|
+
/** if list is inside a Menu, it will get a role from the Menu */
|
27
|
+
|
28
|
+
const {
|
29
|
+
listRole
|
30
|
+
} = React.useContext(MenuContext);
|
24
31
|
return /*#__PURE__*/React.createElement(ListBox, _extends({
|
25
|
-
sx: merge(styles, sxProp)
|
32
|
+
sx: merge(styles, sxProp),
|
33
|
+
role: role || listRole
|
26
34
|
}, props, {
|
27
35
|
ref: forwardedRef
|
28
36
|
}), /*#__PURE__*/React.createElement(ListContext.Provider, {
|
@@ -0,0 +1,10 @@
|
|
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 {};
|
@@ -2,6 +2,7 @@ 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';
|
5
6
|
import { LeadingVisualContainer } from './Visuals';
|
6
7
|
export const Selection = ({
|
7
8
|
selected
|
@@ -12,6 +13,9 @@ export const Selection = ({
|
|
12
13
|
const {
|
13
14
|
selectionVariant: groupSelectionVariant
|
14
15
|
} = React.useContext(GroupContext);
|
16
|
+
const {
|
17
|
+
parent
|
18
|
+
} = React.useContext(MenuContext);
|
15
19
|
/** selectionVariant in Group can override the selectionVariant in List root */
|
16
20
|
|
17
21
|
const selectionVariant = typeof groupSelectionVariant !== 'undefined' ? groupSelectionVariant : listSelectionVariant; // if selectionVariant is not set on List, don't show selection
|
@@ -22,6 +26,11 @@ export const Selection = ({
|
|
22
26
|
return null;
|
23
27
|
}
|
24
28
|
|
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
|
+
|
25
34
|
if (selectionVariant === 'single') {
|
26
35
|
return /*#__PURE__*/React.createElement(LeadingVisualContainer, null, selected && /*#__PURE__*/React.createElement(CheckIcon, null));
|
27
36
|
}
|
@@ -37,7 +46,9 @@ export const Selection = ({
|
|
37
46
|
sx: {
|
38
47
|
rect: {
|
39
48
|
fill: selected ? 'accent.fg' : 'canvas.default',
|
40
|
-
stroke: selected ? 'accent.fg' : 'border.default'
|
49
|
+
stroke: selected ? 'accent.fg' : 'border.default',
|
50
|
+
shapeRendering: 'auto' // this is a workaround to override global style in github/github, see primer/react#1666
|
51
|
+
|
41
52
|
},
|
42
53
|
path: {
|
43
54
|
fill: 'fg.onEmphasis',
|
@@ -1,5 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Divider } from './Divider';
|
3
2
|
export type { ListProps as ActionListProps } from './List';
|
4
3
|
export type { GroupProps } from './Group';
|
5
4
|
export type { ItemProps } from './Item';
|
@@ -26,7 +25,7 @@ export declare const ActionList: import("@radix-ui/react-polymorphic").ForwardRe
|
|
26
25
|
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
27
26
|
}>;
|
28
27
|
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
29
|
-
Divider:
|
28
|
+
Divider: import("react").FC<import("../sx").SxProp>;
|
30
29
|
/** Secondary text which provides additional information about an `Item`. */
|
31
30
|
Description: import("react").FC<import("./Description").DescriptionProps>;
|
32
31
|
/** Icon (or similar) positioned before `Item` text. */
|
@@ -0,0 +1,313 @@
|
|
1
|
+
import { ButtonProps } from './Button';
|
2
|
+
import React from 'react';
|
3
|
+
import { OverlayProps } from './Overlay';
|
4
|
+
import { AnchoredOverlayWrapperAnchorProps } from './AnchoredOverlay/AnchoredOverlay';
|
5
|
+
declare type ActionMenuBaseProps = {
|
6
|
+
/**
|
7
|
+
* Recommended: `ActionMenu.Button` or `ActionMenu.Anchor` with ActionList`
|
8
|
+
*/
|
9
|
+
children: React.ReactElement[] | React.ReactElement;
|
10
|
+
/**
|
11
|
+
* If defined, will control the open/closed state of the overlay. Must be used in conjuction with `onOpenChange`.
|
12
|
+
*/
|
13
|
+
open?: boolean;
|
14
|
+
/**
|
15
|
+
* If defined, will control the open/closed state of the overlay. Must be used in conjuction with `open`.
|
16
|
+
*/
|
17
|
+
onOpenChange?: (s: boolean) => void;
|
18
|
+
/**
|
19
|
+
* Props to be spread on the internal `Overlay` component.
|
20
|
+
*/
|
21
|
+
overlayProps?: Partial<OverlayProps>;
|
22
|
+
};
|
23
|
+
export declare type ActionMenuProps = ActionMenuBaseProps & AnchoredOverlayWrapperAnchorProps;
|
24
|
+
export declare type MenuAnchorProps = {
|
25
|
+
children: React.ReactElement;
|
26
|
+
};
|
27
|
+
/** this component is syntactical sugar 🍭 */
|
28
|
+
export declare type MenuButtonProps = ButtonProps;
|
29
|
+
export declare const ActionMenu: React.FC<ActionMenuProps> & {
|
30
|
+
Button: React.ForwardRefExoticComponent<Pick<{
|
31
|
+
color?: string | undefined;
|
32
|
+
property?: string | undefined;
|
33
|
+
translate?: "yes" | "no" | undefined;
|
34
|
+
hidden?: boolean | undefined;
|
35
|
+
children?: React.ReactNode;
|
36
|
+
value?: string | number | readonly string[] | undefined;
|
37
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
38
|
+
form?: string | undefined;
|
39
|
+
slot?: string | undefined;
|
40
|
+
style?: React.CSSProperties | undefined;
|
41
|
+
title?: string | undefined;
|
42
|
+
variant?: "small" | "medium" | "large" | undefined;
|
43
|
+
role?: React.AriaRole | undefined;
|
44
|
+
sx?: import("./sx").BetterSystemStyleObject | undefined;
|
45
|
+
type?: "button" | "reset" | "submit" | undefined;
|
46
|
+
name?: string | undefined;
|
47
|
+
key?: React.Key | null | undefined;
|
48
|
+
defaultChecked?: boolean | undefined;
|
49
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
50
|
+
suppressContentEditableWarning?: boolean | undefined;
|
51
|
+
suppressHydrationWarning?: boolean | undefined;
|
52
|
+
accessKey?: string | undefined;
|
53
|
+
className?: string | undefined;
|
54
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
55
|
+
contextMenu?: string | undefined;
|
56
|
+
dir?: string | undefined;
|
57
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
58
|
+
id?: string | undefined;
|
59
|
+
lang?: string | undefined;
|
60
|
+
placeholder?: string | undefined;
|
61
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
62
|
+
tabIndex?: number | undefined;
|
63
|
+
radioGroup?: string | undefined;
|
64
|
+
about?: string | undefined;
|
65
|
+
datatype?: string | undefined;
|
66
|
+
inlist?: any;
|
67
|
+
prefix?: string | undefined;
|
68
|
+
resource?: string | undefined;
|
69
|
+
typeof?: string | undefined;
|
70
|
+
vocab?: string | undefined;
|
71
|
+
autoCapitalize?: string | undefined;
|
72
|
+
autoCorrect?: string | undefined;
|
73
|
+
autoSave?: string | undefined;
|
74
|
+
itemProp?: string | undefined;
|
75
|
+
itemScope?: boolean | undefined;
|
76
|
+
itemType?: string | undefined;
|
77
|
+
itemID?: string | undefined;
|
78
|
+
itemRef?: string | undefined;
|
79
|
+
results?: number | undefined;
|
80
|
+
security?: string | undefined;
|
81
|
+
unselectable?: "on" | "off" | undefined;
|
82
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
83
|
+
is?: string | undefined;
|
84
|
+
'aria-activedescendant'?: string | undefined;
|
85
|
+
'aria-atomic'?: boolean | "false" | "true" | undefined;
|
86
|
+
'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
|
87
|
+
'aria-busy'?: boolean | "false" | "true" | undefined;
|
88
|
+
'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
|
89
|
+
'aria-colcount'?: number | undefined;
|
90
|
+
'aria-colindex'?: number | undefined;
|
91
|
+
'aria-colspan'?: number | undefined;
|
92
|
+
'aria-controls'?: string | undefined;
|
93
|
+
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
|
94
|
+
'aria-describedby'?: string | undefined;
|
95
|
+
'aria-details'?: string | undefined;
|
96
|
+
'aria-disabled'?: boolean | "false" | "true" | undefined;
|
97
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
98
|
+
'aria-errormessage'?: string | undefined;
|
99
|
+
'aria-expanded'?: boolean | "false" | "true" | undefined;
|
100
|
+
'aria-flowto'?: string | undefined;
|
101
|
+
'aria-grabbed'?: boolean | "false" | "true" | undefined;
|
102
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
|
103
|
+
'aria-hidden'?: boolean | "false" | "true" | undefined;
|
104
|
+
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
105
|
+
'aria-keyshortcuts'?: string | undefined;
|
106
|
+
'aria-label'?: string | undefined;
|
107
|
+
'aria-labelledby'?: string | undefined;
|
108
|
+
'aria-level'?: number | undefined;
|
109
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
110
|
+
'aria-modal'?: boolean | "false" | "true" | undefined;
|
111
|
+
'aria-multiline'?: boolean | "false" | "true" | undefined;
|
112
|
+
'aria-multiselectable'?: boolean | "false" | "true" | undefined;
|
113
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
114
|
+
'aria-owns'?: string | undefined;
|
115
|
+
'aria-placeholder'?: string | undefined;
|
116
|
+
'aria-posinset'?: number | undefined;
|
117
|
+
'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
|
118
|
+
'aria-readonly'?: boolean | "false" | "true" | undefined;
|
119
|
+
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
120
|
+
'aria-required'?: boolean | "false" | "true" | undefined;
|
121
|
+
'aria-roledescription'?: string | undefined;
|
122
|
+
'aria-rowcount'?: number | undefined;
|
123
|
+
'aria-rowindex'?: number | undefined;
|
124
|
+
'aria-rowspan'?: number | undefined;
|
125
|
+
'aria-selected'?: boolean | "false" | "true" | undefined;
|
126
|
+
'aria-setsize'?: number | undefined;
|
127
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
128
|
+
'aria-valuemax'?: number | undefined;
|
129
|
+
'aria-valuemin'?: number | undefined;
|
130
|
+
'aria-valuenow'?: number | undefined;
|
131
|
+
'aria-valuetext'?: string | undefined;
|
132
|
+
dangerouslySetInnerHTML?: {
|
133
|
+
__html: string;
|
134
|
+
} | undefined;
|
135
|
+
onCopy?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
136
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
137
|
+
onCut?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
138
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
139
|
+
onPaste?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
140
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
141
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
142
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
143
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
144
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
145
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
146
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
147
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
148
|
+
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
149
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
150
|
+
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
151
|
+
onChange?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
152
|
+
onChangeCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
153
|
+
onBeforeInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
154
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
155
|
+
onInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
156
|
+
onInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
157
|
+
onReset?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
158
|
+
onResetCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
159
|
+
onSubmit?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
160
|
+
onSubmitCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
161
|
+
onInvalid?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
162
|
+
onInvalidCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
163
|
+
onLoad?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
164
|
+
onLoadCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
165
|
+
onError?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
166
|
+
onErrorCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
167
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
168
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
169
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
170
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
171
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
172
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
173
|
+
onAbort?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
174
|
+
onAbortCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
175
|
+
onCanPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
176
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
177
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
178
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
179
|
+
onDurationChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
180
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
181
|
+
onEmptied?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
182
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
183
|
+
onEncrypted?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
184
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
185
|
+
onEnded?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
186
|
+
onEndedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
187
|
+
onLoadedData?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
188
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
189
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
190
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
191
|
+
onLoadStart?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
192
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
193
|
+
onPause?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
194
|
+
onPauseCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
195
|
+
onPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
196
|
+
onPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
197
|
+
onPlaying?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
198
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
199
|
+
onProgress?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
200
|
+
onProgressCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
201
|
+
onRateChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
202
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
203
|
+
onSeeked?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
204
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
205
|
+
onSeeking?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
206
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
207
|
+
onStalled?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
208
|
+
onStalledCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
209
|
+
onSuspend?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
210
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
211
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
212
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
213
|
+
onVolumeChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
214
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
215
|
+
onWaiting?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
216
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
217
|
+
onAuxClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
218
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
219
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
220
|
+
onClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
221
|
+
onContextMenu?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
222
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
223
|
+
onDoubleClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
224
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
225
|
+
onDrag?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
226
|
+
onDragCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
227
|
+
onDragEnd?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
228
|
+
onDragEndCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
229
|
+
onDragEnter?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
230
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
231
|
+
onDragExit?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
232
|
+
onDragExitCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
233
|
+
onDragLeave?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
234
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
235
|
+
onDragOver?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
236
|
+
onDragOverCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
237
|
+
onDragStart?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
238
|
+
onDragStartCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
239
|
+
onDrop?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
240
|
+
onDropCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
241
|
+
onMouseDown?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
242
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
243
|
+
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
244
|
+
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
245
|
+
onMouseMove?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
246
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
247
|
+
onMouseOut?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
248
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
249
|
+
onMouseOver?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
250
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
251
|
+
onMouseUp?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
252
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
253
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
254
|
+
onSelectCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
255
|
+
onTouchCancel?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
256
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
257
|
+
onTouchEnd?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
258
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
259
|
+
onTouchMove?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
260
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
261
|
+
onTouchStart?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
262
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
263
|
+
onPointerDown?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
264
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
265
|
+
onPointerMove?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
266
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
267
|
+
onPointerUp?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
268
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
269
|
+
onPointerCancel?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
270
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
271
|
+
onPointerEnter?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
272
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
273
|
+
onPointerLeave?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
274
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
275
|
+
onPointerOver?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
276
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
277
|
+
onPointerOut?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
278
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
279
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
280
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
281
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
282
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
283
|
+
onScroll?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
284
|
+
onScrollCapture?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
285
|
+
onWheel?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
286
|
+
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
287
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
288
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
289
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
290
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
291
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
292
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
293
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
294
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
295
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
296
|
+
disabled?: boolean | undefined;
|
297
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
298
|
+
autoFocus?: boolean | undefined;
|
299
|
+
formAction?: string | undefined;
|
300
|
+
formEncType?: string | undefined;
|
301
|
+
formMethod?: string | undefined;
|
302
|
+
formNoValidate?: boolean | undefined;
|
303
|
+
formTarget?: string | undefined;
|
304
|
+
} & {
|
305
|
+
theme?: any;
|
306
|
+
}, "theme" | "sx" | "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement> | keyof {
|
307
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
308
|
+
variant?: "small" | "medium" | "large" | undefined;
|
309
|
+
}> & React.RefAttributes<React.RefObject<HTMLElement> | undefined>>;
|
310
|
+
Anchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<React.RefObject<HTMLElement> | undefined>>;
|
311
|
+
Divider: React.FC<import("./sx").SxProp>;
|
312
|
+
};
|
313
|
+
export {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import Button from './Button';
|
2
|
+
import React from 'react';
|
3
|
+
import { AnchoredOverlay } from './AnchoredOverlay';
|
4
|
+
import { useProvidedStateOrCreate } from './hooks/useProvidedStateOrCreate';
|
5
|
+
import { useProvidedRefOrCreate } from './hooks';
|
6
|
+
import { Divider } from './ActionList2/Divider';
|
7
|
+
import { MenuContext as ActionListMenuContext } from './ActionList2/MenuContext';
|
8
|
+
|
9
|
+
const ActionMenuBase = ({
|
10
|
+
anchorRef: externalAnchorRef,
|
11
|
+
open,
|
12
|
+
onOpenChange,
|
13
|
+
overlayProps,
|
14
|
+
children
|
15
|
+
}) => {
|
16
|
+
const [combinedOpenState, setCombinedOpenState] = useProvidedStateOrCreate(open, onOpenChange, false);
|
17
|
+
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
18
|
+
const onOpen = React.useCallback(() => setCombinedOpenState(true), [setCombinedOpenState]);
|
19
|
+
const onClose = React.useCallback(() => setCombinedOpenState(false), [setCombinedOpenState]);
|
20
|
+
let renderAnchor = null;
|
21
|
+
const contents = [];
|
22
|
+
React.Children.map(children, child => {
|
23
|
+
if (child.type === MenuButton || child.type === Anchor) {
|
24
|
+
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child, anchorProps);
|
25
|
+
} else {
|
26
|
+
contents.push(child);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
return /*#__PURE__*/React.createElement(AnchoredOverlay, {
|
30
|
+
renderAnchor: renderAnchor,
|
31
|
+
anchorRef: anchorRef,
|
32
|
+
open: combinedOpenState,
|
33
|
+
onOpen: onOpen,
|
34
|
+
onClose: onClose,
|
35
|
+
overlayProps: overlayProps
|
36
|
+
}, /*#__PURE__*/React.createElement(ActionListMenuContext.Provider, {
|
37
|
+
value: {
|
38
|
+
parent: 'ActionMenu',
|
39
|
+
listRole: 'menu',
|
40
|
+
itemRole: 'menuitem',
|
41
|
+
afterSelect: onClose
|
42
|
+
}
|
43
|
+
}, contents));
|
44
|
+
};
|
45
|
+
|
46
|
+
ActionMenuBase.displayName = "ActionMenuBase";
|
47
|
+
const Anchor = /*#__PURE__*/React.forwardRef(({
|
48
|
+
children,
|
49
|
+
...anchorProps
|
50
|
+
}, anchorRef) => {
|
51
|
+
return /*#__PURE__*/React.cloneElement(children, { ...anchorProps,
|
52
|
+
ref: anchorRef
|
53
|
+
});
|
54
|
+
});
|
55
|
+
/** this component is syntactical sugar 🍭 */
|
56
|
+
|
57
|
+
const MenuButton = /*#__PURE__*/React.forwardRef((props, anchorRef) => {
|
58
|
+
return /*#__PURE__*/React.createElement(Anchor, {
|
59
|
+
ref: anchorRef
|
60
|
+
}, /*#__PURE__*/React.createElement(Button, props));
|
61
|
+
});
|
62
|
+
ActionMenuBase.displayName = 'ActionMenu';
|
63
|
+
export const ActionMenu = Object.assign(ActionMenuBase, {
|
64
|
+
Button: MenuButton,
|
65
|
+
Anchor,
|
66
|
+
Divider
|
67
|
+
});
|
@@ -15,6 +15,7 @@ declare const _default: React.FC<{
|
|
15
15
|
Input: import("@radix-ui/react-polymorphic").ForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<{
|
16
16
|
[x: string]: any;
|
17
17
|
[x: number]: any;
|
18
|
+
[x: symbol]: any;
|
18
19
|
} & {
|
19
20
|
theme?: any;
|
20
21
|
} & {
|
@@ -27,6 +28,7 @@ declare const _default: React.FC<{
|
|
27
28
|
}> | undefined;
|
28
29
|
} & Pick<{
|
29
30
|
color?: string | undefined;
|
31
|
+
property?: string | undefined;
|
30
32
|
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
31
33
|
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
32
34
|
translate?: "yes" | "no" | undefined;
|
@@ -62,7 +64,6 @@ declare const _default: React.FC<{
|
|
62
64
|
datatype?: string | undefined;
|
63
65
|
inlist?: any;
|
64
66
|
prefix?: string | undefined;
|
65
|
-
property?: string | undefined;
|
66
67
|
resource?: string | undefined;
|
67
68
|
typeof?: string | undefined;
|
68
69
|
vocab?: string | undefined;
|
@@ -7,6 +7,7 @@ declare type InternalAutocompleteInputProps = {
|
|
7
7
|
declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<{
|
8
8
|
[x: string]: any;
|
9
9
|
[x: number]: any;
|
10
|
+
[x: symbol]: any;
|
10
11
|
} & {
|
11
12
|
theme?: any;
|
12
13
|
} & {
|
@@ -19,6 +20,7 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
19
20
|
}> | undefined;
|
20
21
|
} & Pick<{
|
21
22
|
color?: string | undefined;
|
23
|
+
property?: string | undefined;
|
22
24
|
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
23
25
|
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
24
26
|
translate?: "yes" | "no" | undefined;
|
@@ -54,7 +56,6 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
54
56
|
datatype?: string | undefined;
|
55
57
|
inlist?: any;
|
56
58
|
prefix?: string | undefined;
|
57
|
-
property?: string | undefined;
|
58
59
|
resource?: string | undefined;
|
59
60
|
typeof?: string | undefined;
|
60
61
|
vocab?: string | undefined;
|
package/lib-esm/Avatar.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { SystemCommonProps } from './constants';
|
2
1
|
import { SxProp } from './sx';
|
3
2
|
import { ComponentProps } from './utils/types';
|
4
3
|
declare const Avatar: import("styled-components").StyledComponent<"img", any, {
|
@@ -10,6 +9,6 @@ declare const Avatar: import("styled-components").StyledComponent<"img", any, {
|
|
10
9
|
src: string;
|
11
10
|
/** Provide alt text when the Avatar is used without the user's name next to it. */
|
12
11
|
alt?: string | undefined;
|
13
|
-
} &
|
12
|
+
} & SxProp, never>;
|
14
13
|
export declare type AvatarProps = ComponentProps<typeof Avatar>;
|
15
14
|
export default Avatar;
|