@primer/components 0.0.0-202111231117 → 0.0.0-202111301520
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/dist/browser.esm.js +2 -2227
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2 -2227
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Header.js +1 -1
- package/lib/ActionList/Item.js +10 -10
- package/lib/ActionList/List.js +1 -1
- package/lib/ActionList2/Divider.d.ts +3 -2
- package/lib/ActionList2/Divider.js +10 -5
- package/lib/ActionList2/Item.js +22 -6
- package/lib/ActionList2/List.js +12 -2
- package/lib/ActionList2/MenuContext.d.ts +10 -0
- package/lib/{_InputField/InputFieldValidation.js → ActionList2/MenuContext.js} +4 -6
- package/lib/ActionList2/Selection.js +11 -0
- 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/Autocomplete/AutocompleteMenu.js +13 -6
- package/lib/Avatar.d.ts +1 -2
- package/lib/Avatar.js +1 -1
- package/lib/BaseStyles.js +2 -20
- package/lib/BorderBox.js +1 -1
- package/lib/Box.js +1 -1
- package/lib/BranchName.d.ts +1 -2
- package/lib/BranchName.js +1 -1
- package/lib/Breadcrumbs.js +3 -3
- package/lib/Button/Button.d.ts +2 -2
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.d.ts +2 -2
- package/lib/Button/ButtonDanger.d.ts +2 -2
- package/lib/Button/ButtonGroup.js +1 -1
- 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/Checkbox.d.ts +1 -1
- package/lib/Checkbox.js +1 -1
- package/lib/CircleOcticon.d.ts +35 -35
- package/lib/Details.d.ts +1 -2
- package/lib/Details.js +2 -4
- 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/FilteredActionList/FilteredActionList.js +1 -1
- package/lib/Flex.js +1 -1
- package/lib/Heading.d.ts +1 -2
- package/lib/Heading.js +1 -6
- package/lib/LabelGroup.js +1 -1
- package/lib/Overlay.js +1 -1
- package/lib/Pagination/Pagination.js +2 -2
- package/lib/Position.d.ts +4 -4
- package/lib/Position.js +1 -1
- package/lib/ProgressBar.d.ts +16 -11
- package/lib/ProgressBar.js +6 -10
- package/lib/SelectMenu/SelectMenu.d.ts +11 -10
- package/lib/SelectMenu/SelectMenu.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/Spinner.d.ts +1 -2
- package/lib/Spinner.js +1 -3
- package/lib/StateLabel.js +1 -1
- package/lib/StyledOcticon.js +1 -1
- package/lib/SubNav.js +3 -3
- package/lib/TextInputWithTokens.d.ts +2 -1
- package/lib/ThemeProvider.d.ts +1 -0
- package/lib/ThemeProvider.js +17 -4
- package/lib/Timeline.js +4 -4
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/AvatarToken.js +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/TokenBase.js +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/UnderlineNav.js +2 -2
- package/lib/drafts.d.ts +1 -0
- package/lib/drafts.js +13 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -38
- package/lib-esm/ActionList/Header.js +1 -1
- package/lib-esm/ActionList/Item.js +10 -10
- package/lib-esm/ActionList/List.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 +20 -6
- package/lib-esm/ActionList2/List.js +10 -2
- package/lib-esm/ActionList2/MenuContext.d.ts +10 -0
- package/lib-esm/ActionList2/MenuContext.js +3 -0
- package/lib-esm/ActionList2/Selection.js +9 -0
- 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/Autocomplete/AutocompleteMenu.js +13 -3
- package/lib-esm/Avatar.d.ts +1 -2
- package/lib-esm/Avatar.js +2 -2
- package/lib-esm/BaseStyles.js +2 -20
- package/lib-esm/BorderBox.js +1 -1
- package/lib-esm/Box.js +1 -1
- package/lib-esm/BranchName.d.ts +1 -2
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Breadcrumbs.js +3 -3
- package/lib-esm/Button/Button.d.ts +2 -2
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -2
- package/lib-esm/Button/ButtonGroup.js +1 -1
- 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/Checkbox.d.ts +1 -1
- package/lib-esm/Checkbox.js +1 -1
- package/lib-esm/CircleOcticon.d.ts +35 -35
- package/lib-esm/Details.d.ts +1 -2
- package/lib-esm/Details.js +2 -3
- 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/FilteredActionList/FilteredActionList.js +1 -1
- package/lib-esm/Flex.js +1 -1
- package/lib-esm/Heading.d.ts +1 -2
- package/lib-esm/Heading.js +2 -6
- package/lib-esm/LabelGroup.js +1 -1
- package/lib-esm/Overlay.js +1 -1
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/Position.js +1 -1
- 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/SelectMenu.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib-esm/Spinner.d.ts +1 -2
- package/lib-esm/Spinner.js +1 -2
- package/lib-esm/StateLabel.js +1 -1
- package/lib-esm/StyledOcticon.js +1 -1
- package/lib-esm/SubNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +2 -1
- package/lib-esm/ThemeProvider.d.ts +1 -0
- package/lib-esm/ThemeProvider.js +17 -4
- package/lib-esm/Timeline.js +4 -4
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/AvatarToken.js +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/TokenBase.js +1 -1
- package/lib-esm/Tooltip.js +1 -1
- package/lib-esm/UnderlineNav.js +2 -2
- package/lib-esm/drafts.d.ts +1 -0
- package/lib-esm/drafts.js +2 -1
- package/lib-esm/index.d.ts +0 -4
- package/lib-esm/index.js +0 -4
- package/package.json +15 -9
- package/CHANGELOG.md +0 -986
- package/lib/CheckboxInputField.d.ts +0 -11
- package/lib/CheckboxInputField.js +0 -73
- package/lib/ChoiceFieldset/ChoiceFieldCaption.d.ts +0 -3
- package/lib/ChoiceFieldset/ChoiceFieldCaption.js +0 -35
- package/lib/ChoiceFieldset/ChoiceFieldLabel.d.ts +0 -3
- package/lib/ChoiceFieldset/ChoiceFieldLabel.js +0 -35
- package/lib/ChoiceFieldset/ChoiceFieldset.d.ts +0 -65
- package/lib/ChoiceFieldset/ChoiceFieldset.js +0 -95
- package/lib/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +0 -3
- package/lib/ChoiceFieldset/ChoiceFieldsetDescription.js +0 -29
- package/lib/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +0 -9
- package/lib/ChoiceFieldset/ChoiceFieldsetLegend.js +0 -44
- package/lib/ChoiceFieldset/ChoiceFieldsetList.d.ts +0 -9
- package/lib/ChoiceFieldset/ChoiceFieldsetList.js +0 -80
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +0 -19
- package/lib/ChoiceFieldset/ChoiceFieldsetListContext.js +0 -15
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +0 -25
- package/lib/ChoiceFieldset/ChoiceFieldsetListItem.js +0 -75
- package/lib/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +0 -6
- package/lib/ChoiceFieldset/ChoiceFieldsetValidation.js +0 -17
- package/lib/ChoiceFieldset/index.d.ts +0 -3
- package/lib/ChoiceFieldset/index.js +0 -23
- package/lib/RadioInputField.d.ts +0 -9
- package/lib/RadioInputField.js +0 -82
- package/lib/TextInputField.d.ts +0 -581
- package/lib/TextInputField.js +0 -66
- package/lib/_InputCaption.d.ts +0 -13
- package/lib/_InputCaption.js +0 -27
- package/lib/_InputField/InputField.d.ts +0 -39
- package/lib/_InputField/InputField.js +0 -90
- package/lib/_InputField/InputFieldCaption.d.ts +0 -3
- package/lib/_InputField/InputFieldCaption.js +0 -30
- package/lib/_InputField/InputFieldLabel.d.ts +0 -9
- package/lib/_InputField/InputFieldLabel.js +0 -34
- package/lib/_InputField/InputFieldValidation.d.ts +0 -6
- package/lib/_InputField/ToggleInputField.d.ts +0 -13
- package/lib/_InputField/ToggleInputField.js +0 -71
- package/lib/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
- package/lib/_InputField/ToggleInputLeadingVisual.js +0 -22
- package/lib/_InputField/ValidationAnimationContainer.d.ts +0 -6
- package/lib/_InputField/ValidationAnimationContainer.js +0 -48
- package/lib/_InputField/index.d.ts +0 -1
- package/lib/_InputField/index.js +0 -15
- package/lib/_InputField/slots.d.ts +0 -13
- package/lib/_InputField/slots.js +0 -17
- package/lib/_InputLabel.d.ts +0 -8
- package/lib/_InputLabel.js +0 -44
- package/lib/_InputValidation.d.ts +0 -8
- package/lib/_InputValidation.js +0 -56
- package/lib/_VisuallyHidden.d.ts +0 -6
- package/lib/_VisuallyHidden.js +0 -39
- package/lib/utils/types/FormValidationStatus.d.ts +0 -1
- package/lib/utils/types/FormValidationStatus.js +0 -1
- package/lib-esm/CheckboxInputField.d.ts +0 -11
- package/lib-esm/CheckboxInputField.js +0 -56
- package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.d.ts +0 -3
- package/lib-esm/ChoiceFieldset/ChoiceFieldCaption.js +0 -20
- package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.d.ts +0 -3
- package/lib-esm/ChoiceFieldset/ChoiceFieldLabel.js +0 -20
- package/lib-esm/ChoiceFieldset/ChoiceFieldset.d.ts +0 -65
- package/lib-esm/ChoiceFieldset/ChoiceFieldset.js +0 -72
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.d.ts +0 -3
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetDescription.js +0 -17
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.d.ts +0 -9
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetLegend.js +0 -31
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.d.ts +0 -9
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetList.js +0 -63
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.d.ts +0 -19
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListContext.js +0 -5
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.d.ts +0 -25
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetListItem.js +0 -51
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.d.ts +0 -6
- package/lib-esm/ChoiceFieldset/ChoiceFieldsetValidation.js +0 -7
- package/lib-esm/ChoiceFieldset/index.d.ts +0 -3
- package/lib-esm/ChoiceFieldset/index.js +0 -2
- package/lib-esm/RadioInputField.d.ts +0 -9
- package/lib-esm/RadioInputField.js +0 -65
- package/lib-esm/TextInputField.d.ts +0 -581
- package/lib-esm/TextInputField.js +0 -50
- package/lib-esm/_InputCaption.d.ts +0 -13
- package/lib-esm/_InputCaption.js +0 -16
- package/lib-esm/_InputField/InputField.d.ts +0 -39
- package/lib-esm/_InputField/InputField.js +0 -70
- package/lib-esm/_InputField/InputFieldCaption.d.ts +0 -3
- package/lib-esm/_InputField/InputFieldCaption.js +0 -18
- package/lib-esm/_InputField/InputFieldLabel.d.ts +0 -9
- package/lib-esm/_InputField/InputFieldLabel.js +0 -22
- package/lib-esm/_InputField/InputFieldValidation.d.ts +0 -6
- package/lib-esm/_InputField/InputFieldValidation.js +0 -7
- package/lib-esm/_InputField/ToggleInputField.d.ts +0 -13
- package/lib-esm/_InputField/ToggleInputField.js +0 -54
- package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
- package/lib-esm/_InputField/ToggleInputLeadingVisual.js +0 -11
- package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +0 -6
- package/lib-esm/_InputField/ValidationAnimationContainer.js +0 -33
- package/lib-esm/_InputField/index.d.ts +0 -1
- package/lib-esm/_InputField/index.js +0 -1
- package/lib-esm/_InputField/slots.d.ts +0 -13
- package/lib-esm/_InputField/slots.js +0 -5
- package/lib-esm/_InputLabel.d.ts +0 -8
- package/lib-esm/_InputLabel.js +0 -32
- package/lib-esm/_InputValidation.d.ts +0 -8
- package/lib-esm/_InputValidation.js +0 -43
- package/lib-esm/_VisuallyHidden.d.ts +0 -6
- package/lib-esm/_VisuallyHidden.js +0 -26
- package/lib-esm/utils/types/FormValidationStatus.d.ts +0 -1
- package/lib-esm/utils/types/FormValidationStatus.js +0 -1
@@ -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
|
}
|
@@ -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;
|
@@ -6,7 +6,6 @@ import { AutocompleteContext } from './AutocompleteContext';
|
|
6
6
|
import { PlusIcon } from '@primer/octicons-react';
|
7
7
|
import { uniqueId } from '../utils/uniqueId';
|
8
8
|
import { scrollIntoViewingArea } from '../behaviors/scrollIntoViewingArea';
|
9
|
-
import VisuallyHidden from '../_VisuallyHidden';
|
10
9
|
|
11
10
|
const getDefaultSortFn = isItemSelectedFn => (itemIdA, itemIdB) => isItemSelectedFn(itemIdA) === isItemSelectedFn(itemIdB) ? 0 : isItemSelectedFn(itemIdA) ? -1 : 1;
|
12
11
|
|
@@ -165,8 +164,19 @@ function AutocompleteMenu(props) {
|
|
165
164
|
setSelectedItemLength(selectedItemIds.length);
|
166
165
|
}
|
167
166
|
}, [selectedItemIds, setSelectedItemLength]);
|
168
|
-
return /*#__PURE__*/React.createElement(
|
169
|
-
|
167
|
+
return /*#__PURE__*/React.createElement(Box, {
|
168
|
+
sx: !showMenu ? {
|
169
|
+
// visually hides this label for sighted users
|
170
|
+
position: 'absolute',
|
171
|
+
width: '1px',
|
172
|
+
height: '1px',
|
173
|
+
padding: '0',
|
174
|
+
margin: '-1px',
|
175
|
+
overflow: 'hidden',
|
176
|
+
clip: 'rect(0, 0, 0, 0)',
|
177
|
+
whiteSpace: 'nowrap',
|
178
|
+
borderWidth: '0'
|
179
|
+
} : {}
|
170
180
|
}, loading ? /*#__PURE__*/React.createElement(Box, {
|
171
181
|
p: 3,
|
172
182
|
display: "flex",
|
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;
|
package/lib-esm/Avatar.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
import {
|
2
|
+
import { get } from './constants';
|
3
3
|
import sx from './sx';
|
4
4
|
|
5
5
|
function getBorderRadius({
|
@@ -19,7 +19,7 @@ const Avatar = styled.img.attrs(props => ({
|
|
19
19
|
})).withConfig({
|
20
20
|
displayName: "Avatar",
|
21
21
|
componentId: "sc-1waaaky-0"
|
22
|
-
})(["display:inline-block;overflow:hidden;line-height:", ";vertical-align:middle;border-radius:", ";", "
|
22
|
+
})(["display:inline-block;overflow:hidden;line-height:", ";vertical-align:middle;border-radius:", ";", ""], get('lineHeights.condensedUltra'), props => getBorderRadius(props), sx);
|
23
23
|
Avatar.defaultProps = {
|
24
24
|
size: 20,
|
25
25
|
alt: '',
|
package/lib-esm/BaseStyles.js
CHANGED
@@ -3,28 +3,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled, { createGlobalStyle } from 'styled-components';
|
5
5
|
import { COMMON, TYPOGRAPHY } from './constants';
|
6
|
-
const GlobalStyle = createGlobalStyle
|
7
|
-
* { box-sizing: border-box; }
|
8
|
-
body { margin: 0; }
|
9
|
-
table { border-collapse: collapse; }
|
10
|
-
|
11
|
-
[role="button"]:focus:not(:focus-visible):not(.focus-visible),
|
12
|
-
[role="tabpanel"][tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),
|
13
|
-
button:focus:not(:focus-visible):not(.focus-visible),
|
14
|
-
summary:focus:not(:focus-visible):not(.focus-visible),
|
15
|
-
a:focus:not(:focus-visible):not(.focus-visible) {
|
16
|
-
outline: none;
|
17
|
-
box-shadow: none;
|
18
|
-
}
|
19
|
-
|
20
|
-
[tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),
|
21
|
-
details-dialog:focus:not(:focus-visible):not(.focus-visible) {
|
22
|
-
outline: none;
|
23
|
-
}
|
24
|
-
`;
|
6
|
+
const GlobalStyle = createGlobalStyle(["*{box-sizing:border-box;}body{margin:0;}table{border-collapse:collapse;}[role=\"button\"]:focus:not(:focus-visible):not(.focus-visible),[role=\"tabpanel\"][tabindex=\"0\"]:focus:not(:focus-visible):not(.focus-visible),button:focus:not(:focus-visible):not(.focus-visible),summary:focus:not(:focus-visible):not(.focus-visible),a:focus:not(:focus-visible):not(.focus-visible){outline:none;box-shadow:none;}[tabindex=\"0\"]:focus:not(:focus-visible):not(.focus-visible),details-dialog:focus:not(:focus-visible):not(.focus-visible){outline:none;}"]);
|
25
7
|
const Base = styled.div.withConfig({
|
26
8
|
displayName: "BaseStyles__Base",
|
27
|
-
componentId: "qvuaww-0"
|
9
|
+
componentId: "sc-qvuaww-0"
|
28
10
|
})(["", ";", ";"], TYPOGRAPHY, COMMON);
|
29
11
|
|
30
12
|
function BaseStyles(props) {
|
package/lib-esm/BorderBox.js
CHANGED
package/lib-esm/Box.js
CHANGED
@@ -3,6 +3,6 @@ import { background, border, color, flexbox, grid, layout, position, shadow, spa
|
|
3
3
|
import sx from './sx';
|
4
4
|
const Box = styled.div.withConfig({
|
5
5
|
displayName: "Box",
|
6
|
-
componentId: "nv15kw-0"
|
6
|
+
componentId: "sc-nv15kw-0"
|
7
7
|
})(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
|
8
8
|
export default Box;
|
package/lib-esm/BranchName.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { SystemCommonProps } from './constants';
|
2
1
|
import { SxProp } from './sx';
|
3
2
|
import { ComponentProps } from './utils/types';
|
4
|
-
declare const BranchName: import("styled-components").StyledComponent<"a", any,
|
3
|
+
declare const BranchName: import("styled-components").StyledComponent<"a", any, SxProp, never>;
|
5
4
|
export declare type BranchNameProps = ComponentProps<typeof BranchName>;
|
6
5
|
export default BranchName;
|
package/lib-esm/BranchName.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
import {
|
2
|
+
import { get } from './constants';
|
3
3
|
import sx from './sx';
|
4
4
|
const BranchName = styled.a.withConfig({
|
5
5
|
displayName: "BranchName",
|
6
6
|
componentId: "sc-167ouzm-0"
|
7
|
-
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";"
|
7
|
+
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";"], get('fontSizes.0'), get('fonts.mono'), get('colors.fg.muted'), get('colors.accent.subtle'), get('radii.2'), sx);
|
8
8
|
export default BranchName;
|
package/lib-esm/Breadcrumbs.js
CHANGED
@@ -8,11 +8,11 @@ import sx from './sx';
|
|
8
8
|
const SELECTED_CLASS = 'selected';
|
9
9
|
const Wrapper = styled.li.withConfig({
|
10
10
|
displayName: "Breadcrumbs__Wrapper",
|
11
|
-
componentId: "hwwoo0-0"
|
11
|
+
componentId: "sc-hwwoo0-0"
|
12
12
|
})(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], get('colors.fg.muted'), get('fontSizes.1'));
|
13
13
|
const BreadcrumbsBase = styled.nav.withConfig({
|
14
14
|
displayName: "Breadcrumbs__BreadcrumbsBase",
|
15
|
-
componentId: "hwwoo0-1"
|
15
|
+
componentId: "sc-hwwoo0-1"
|
16
16
|
})(["display:flex;justify-content:space-between;", ";"], sx);
|
17
17
|
|
18
18
|
function Breadcrumbs({
|
@@ -39,7 +39,7 @@ const BreadcrumbsItem = styled.a.attrs(props => ({
|
|
39
39
|
'aria-current': props.selected ? 'page' : null
|
40
40
|
})).withConfig({
|
41
41
|
displayName: "Breadcrumbs__BreadcrumbsItem",
|
42
|
-
componentId: "hwwoo0-2"
|
42
|
+
componentId: "sc-hwwoo0-2"
|
43
43
|
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", ";"], get('colors.accent.fg'), get('fontSizes.1'), get('colors.fg.default'), sx);
|
44
44
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
45
45
|
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|