@carbon/react 1.48.0 → 1.48.1
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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +948 -948
- package/es/components/ComboButton/index.js +0 -1
- package/es/components/Menu/Menu.js +10 -33
- package/es/components/Menu/MenuItem.js +12 -17
- package/es/components/MenuButton/index.js +0 -1
- package/es/components/OverflowMenu/next/index.js +0 -1
- package/es/index.js +2 -2
- package/lib/components/ComboButton/index.js +0 -1
- package/lib/components/Menu/Menu.js +10 -33
- package/lib/components/Menu/MenuItem.js +12 -17
- package/lib/components/MenuButton/index.js +0 -1
- package/lib/components/OverflowMenu/next/index.js +0 -1
- package/lib/index.js +8 -8
- package/package.json +5 -5
- package/es/components/Menu/Menu.d.ts +0 -59
- package/es/components/Menu/MenuContext.d.ts +0 -32
- package/es/components/Menu/MenuItem.d.ts +0 -119
- package/es/components/Menu/index.d.ts +0 -9
- package/lib/components/Menu/Menu.d.ts +0 -59
- package/lib/components/Menu/MenuContext.d.ts +0 -32
- package/lib/components/Menu/MenuItem.d.ts +0 -119
- package/lib/components/Menu/index.d.ts +0 -9
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { Menu } from './Menu';
|
|
8
|
-
import { MenuItem, MenuItemDivider, MenuItemGroup, MenuItemRadioGroup, MenuItemSelectable } from './MenuItem';
|
|
9
|
-
export { Menu, MenuItem, MenuItemDivider, MenuItemGroup, MenuItemRadioGroup, MenuItemSelectable, };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
9
|
-
/**
|
|
10
|
-
* A collection of MenuItems to be rendered within this Menu.
|
|
11
|
-
*/
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Additional CSS class names.
|
|
15
|
-
*/
|
|
16
|
-
className?: string;
|
|
17
|
-
/**
|
|
18
|
-
* A label describing the Menu.
|
|
19
|
-
*/
|
|
20
|
-
label?: string;
|
|
21
|
-
/**
|
|
22
|
-
* The mode of this menu. Defaults to full.
|
|
23
|
-
* `full` supports nesting and selectable menu items, but no icons.
|
|
24
|
-
* `basic` supports icons but no nesting or selectable menu items.
|
|
25
|
-
*
|
|
26
|
-
* **This prop is not intended for use and will be set by the respective implementation (like useContextMenu, MenuButton, and ComboButton).**
|
|
27
|
-
*/
|
|
28
|
-
mode?: 'full' | 'basic';
|
|
29
|
-
/**
|
|
30
|
-
* Provide an optional function to be called when the Menu should be closed.
|
|
31
|
-
*/
|
|
32
|
-
onClose?: () => void;
|
|
33
|
-
/**
|
|
34
|
-
* Provide an optional function to be called when the Menu is opened.
|
|
35
|
-
*/
|
|
36
|
-
onOpen?: () => void;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the Menu is open or not.
|
|
39
|
-
*/
|
|
40
|
-
open?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Specify the size of the Menu.
|
|
43
|
-
*/
|
|
44
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
45
|
-
/**
|
|
46
|
-
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
47
|
-
*/
|
|
48
|
-
target?: any;
|
|
49
|
-
/**
|
|
50
|
-
* Specify the x position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([x1, x2])
|
|
51
|
-
*/
|
|
52
|
-
x?: number | (number | null | undefined)[];
|
|
53
|
-
/**
|
|
54
|
-
* Specify the y position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([y1, y2])
|
|
55
|
-
*/
|
|
56
|
-
y?: number | (number | null | undefined)[];
|
|
57
|
-
}
|
|
58
|
-
declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
59
|
-
export { Menu };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
type ActionType = {
|
|
9
|
-
type: 'enableIcons' | 'registerItem';
|
|
10
|
-
payload: any;
|
|
11
|
-
};
|
|
12
|
-
type StateType = {
|
|
13
|
-
isRoot: boolean;
|
|
14
|
-
mode: 'full' | 'basic';
|
|
15
|
-
hasIcons: boolean;
|
|
16
|
-
size: 'xs' | 'sm' | 'md' | 'lg' | null;
|
|
17
|
-
items: any[];
|
|
18
|
-
requestCloseRoot: (e: Pick<React.KeyboardEvent<HTMLUListElement>, 'type'>) => void;
|
|
19
|
-
};
|
|
20
|
-
declare function menuReducer(state: StateType, action: ActionType): {
|
|
21
|
-
hasIcons: boolean;
|
|
22
|
-
isRoot: boolean;
|
|
23
|
-
mode: "full" | "basic";
|
|
24
|
-
size: "sm" | "md" | "lg" | "xs" | null;
|
|
25
|
-
items: any[];
|
|
26
|
-
requestCloseRoot: (e: Pick<React.KeyboardEvent<HTMLUListElement>, "type">) => void;
|
|
27
|
-
};
|
|
28
|
-
declare const MenuContext: React.Context<{
|
|
29
|
-
state: StateType;
|
|
30
|
-
dispatch: React.Dispatch<any>;
|
|
31
|
-
}>;
|
|
32
|
-
export { MenuContext, menuReducer };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
interface MenuItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Optionally provide another Menu to create a submenu. props.children can't be used to specify the content of the MenuItem itself. Use props.label instead.
|
|
11
|
-
*/
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Additional CSS class names.
|
|
15
|
-
*/
|
|
16
|
-
className?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Specify whether the MenuItem is disabled or not.
|
|
19
|
-
*/
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Specify the kind of the MenuItem.
|
|
23
|
-
*/
|
|
24
|
-
kind?: 'default' | 'danger';
|
|
25
|
-
/**
|
|
26
|
-
* A required label titling the MenuItem. Will be rendered as its text content.
|
|
27
|
-
*/
|
|
28
|
-
label: string;
|
|
29
|
-
/**
|
|
30
|
-
* Provide an optional function to be called when the MenuItem is clicked.
|
|
31
|
-
*/
|
|
32
|
-
onClick?: (event: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLLIElement>) => void;
|
|
33
|
-
/**
|
|
34
|
-
* Only applicable if the parent menu is in `basic` mode. Sets the menu item's icon.
|
|
35
|
-
*/
|
|
36
|
-
renderIcon?: any;
|
|
37
|
-
/**
|
|
38
|
-
* Provide a shortcut for the action of this MenuItem. Note that the component will only render it as a hint but not actually register the shortcut.
|
|
39
|
-
*/
|
|
40
|
-
shortcut?: string;
|
|
41
|
-
}
|
|
42
|
-
declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
43
|
-
interface MenuItemSelectableProps {
|
|
44
|
-
/**
|
|
45
|
-
* Additional CSS class names.
|
|
46
|
-
*/
|
|
47
|
-
className?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Specify whether the option should be selected by default.
|
|
50
|
-
*/
|
|
51
|
-
defaultSelected?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* A required label titling this option.
|
|
54
|
-
*/
|
|
55
|
-
label: string;
|
|
56
|
-
/**
|
|
57
|
-
* Provide an optional function to be called when the selection state changes.
|
|
58
|
-
*/
|
|
59
|
-
onChange?: React.ChangeEventHandler<HTMLLIElement>;
|
|
60
|
-
/**
|
|
61
|
-
* Pass a bool to props.selected to control the state of this option.
|
|
62
|
-
*/
|
|
63
|
-
selected?: boolean;
|
|
64
|
-
}
|
|
65
|
-
declare const MenuItemSelectable: React.ForwardRefExoticComponent<MenuItemSelectableProps & React.RefAttributes<HTMLLIElement>>;
|
|
66
|
-
interface MenuItemGroupProps {
|
|
67
|
-
/**
|
|
68
|
-
* A collection of MenuItems to be rendered within this group.
|
|
69
|
-
*/
|
|
70
|
-
children?: React.ReactNode;
|
|
71
|
-
/**
|
|
72
|
-
* Additional CSS class names.
|
|
73
|
-
*/
|
|
74
|
-
className?: string;
|
|
75
|
-
/**
|
|
76
|
-
* A required label titling this group.
|
|
77
|
-
*/
|
|
78
|
-
label: string;
|
|
79
|
-
}
|
|
80
|
-
declare const MenuItemGroup: React.ForwardRefExoticComponent<MenuItemGroupProps & React.RefAttributes<HTMLLIElement>>;
|
|
81
|
-
interface MenuItemRadioGroupProps {
|
|
82
|
-
/**
|
|
83
|
-
* Additional CSS class names.
|
|
84
|
-
*/
|
|
85
|
-
className?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Specify the default selected item. Must match the type of props.items.
|
|
88
|
-
*/
|
|
89
|
-
defaultSelectedItem?: any;
|
|
90
|
-
/**
|
|
91
|
-
* Provide a function to convert an item to the string that will be rendered. Defaults to item.toString().
|
|
92
|
-
*/
|
|
93
|
-
itemToString?: (item: any) => string;
|
|
94
|
-
/**
|
|
95
|
-
* Provide the options for this radio group. Can be of any type, as long as you provide an appropriate props.itemToString function.
|
|
96
|
-
*/
|
|
97
|
-
items?: any[];
|
|
98
|
-
/**
|
|
99
|
-
* A required label titling this radio group.
|
|
100
|
-
*/
|
|
101
|
-
label: string;
|
|
102
|
-
/**
|
|
103
|
-
* Provide an optional function to be called when the selection changes.
|
|
104
|
-
*/
|
|
105
|
-
onChange?: React.ChangeEventHandler<HTMLLIElement>;
|
|
106
|
-
/**
|
|
107
|
-
* Provide props.selectedItem to control the state of this radio group. Must match the type of props.items.
|
|
108
|
-
*/
|
|
109
|
-
selectedItem?: any;
|
|
110
|
-
}
|
|
111
|
-
declare const MenuItemRadioGroup: React.ForwardRefExoticComponent<MenuItemRadioGroupProps & React.RefAttributes<HTMLLIElement>>;
|
|
112
|
-
interface MenuItemDividerProps {
|
|
113
|
-
/**
|
|
114
|
-
* Additional CSS class names.
|
|
115
|
-
*/
|
|
116
|
-
className?: string;
|
|
117
|
-
}
|
|
118
|
-
declare const MenuItemDivider: React.ForwardRefExoticComponent<MenuItemDividerProps & React.RefAttributes<HTMLLIElement>>;
|
|
119
|
-
export { MenuItem, MenuItemSelectable, MenuItemGroup, MenuItemRadioGroup, MenuItemDivider, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { Menu } from './Menu';
|
|
8
|
-
import { MenuItem, MenuItemDivider, MenuItemGroup, MenuItemRadioGroup, MenuItemSelectable } from './MenuItem';
|
|
9
|
-
export { Menu, MenuItem, MenuItemDivider, MenuItemGroup, MenuItemRadioGroup, MenuItemSelectable, };
|