@carbon/react 1.48.1 → 1.49.0
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 +875 -916
- package/es/components/Accordion/Accordion.Skeleton.d.ts +1 -2
- package/es/components/Accordion/Accordion.d.ts +1 -1
- package/es/components/Accordion/AccordionItem.d.ts +1 -1
- package/es/components/Accordion/AccordionItem.js +5 -0
- package/es/components/Accordion/AccordionProvider.d.ts +1 -1
- package/es/components/AspectRatio/AspectRatio.d.ts +1 -1
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +1 -1
- package/es/components/Checkbox/Checkbox.Skeleton.d.ts +1 -1
- package/es/components/ClassPrefix/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/DataTable/Table.d.ts +1 -1
- package/es/components/DataTable/TableBatchAction.d.ts +1 -1
- package/es/components/DataTable/TableBody.d.ts +1 -1
- package/es/components/DataTable/TableContainer.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandedRow.d.ts +1 -1
- package/es/components/DataTable/TableRow.d.ts +1 -1
- package/es/components/DataTable/TableSelectAll.d.ts +1 -1
- package/es/components/DataTable/TableSelectRow.d.ts +1 -1
- package/es/components/DataTable/TableSlugRow.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +3 -3
- package/es/components/DatePicker/DatePicker.Skeleton.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.d.ts +1 -3
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +1 -2
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/es/components/FileUploader/Filename.d.ts +1 -1
- package/es/components/Form/Form.d.ts +1 -1
- package/es/components/FormGroup/FormGroup.d.ts +1 -1
- package/es/components/FormItem/FormItem.d.ts +1 -1
- package/es/components/FormLabel/FormLabel.d.ts +1 -1
- package/es/components/Heading/index.d.ts +5 -5
- package/es/components/Icon/Icon.Skeleton.d.ts +1 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/es/components/ListBox/ListBoxMenu.d.ts +1 -0
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/Loading/Loading.d.ts +1 -2
- package/es/components/Loading/Loading.js +2 -2
- package/es/components/Menu/Menu.d.ts +59 -0
- package/es/components/Menu/Menu.js +33 -10
- package/es/components/Menu/MenuContext.d.ts +32 -0
- package/es/components/Menu/MenuItem.d.ts +119 -0
- package/es/components/Menu/MenuItem.js +17 -12
- package/es/components/Menu/index.d.ts +9 -0
- package/es/components/MenuButton/index.js +1 -0
- package/es/components/ModalWrapper/ModalWrapper.d.ts +1 -1
- package/es/components/Notification/Notification.d.ts +8 -6
- package/es/components/Notification/Notification.js +2 -1
- package/es/components/NumberInput/NumberInput.Skeleton.d.ts +1 -1
- package/es/components/OrderedList/OrderedList.d.ts +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -0
- package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/es/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/es/components/RadioButton/RadioButton.Skeleton.d.ts +1 -1
- package/es/components/Search/Search.Skeleton.d.ts +1 -1
- package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/es/components/Select/Select.Skeleton.d.ts +1 -1
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/SelectItem/SelectItem.d.ts +1 -1
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +1 -1
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +1 -1
- package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/es/components/Slider/Slider.Skeleton.d.ts +1 -1
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/SliderHandles.d.ts +4 -4
- package/es/components/Stack/index.d.ts +4 -3
- package/es/components/StructuredList/StructuredList.Skeleton.d.ts +1 -2
- package/es/components/StructuredList/StructuredList.d.ts +6 -6
- package/es/components/TabContent/TabContent.d.ts +1 -1
- package/es/components/Tabs/Tabs.Skeleton.d.ts +1 -1
- package/es/components/Tabs/Tabs.d.ts +3 -3
- package/es/components/Tag/Tag.Skeleton.d.ts +1 -1
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Text/Text.d.ts +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/Text/createTextComponent.d.ts +1 -1
- package/es/components/Text/index.d.ts +2 -2
- package/es/components/TextArea/TextArea.Skeleton.d.ts +1 -1
- package/es/components/TextInput/TextInput.Skeleton.d.ts +1 -1
- package/es/components/Theme/index.d.ts +4 -2
- package/es/components/TileGroup/TileGroup.d.ts +1 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/Toggletip/index.d.ts +5 -5
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -2
- package/es/components/UIShell/Content.d.ts +61 -49
- package/es/components/UIShell/HeaderContainer.d.ts +1 -1
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -1
- package/es/components/UIShell/HeaderName.d.ts +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +1 -1
- package/es/components/UIShell/HeaderSideNavItems.d.ts +1 -1
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +1 -1
- package/es/components/UIShell/SideNavFooter.d.ts +1 -1
- package/es/components/UIShell/SideNavLinkText.d.ts +1 -1
- package/es/components/UIShell/SkipToContent.d.ts +1 -1
- package/es/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/es/index.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +1 -2
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/AccordionItem.d.ts +1 -1
- package/lib/components/Accordion/AccordionItem.js +5 -0
- package/lib/components/Accordion/AccordionProvider.d.ts +1 -1
- package/lib/components/AspectRatio/AspectRatio.d.ts +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.Skeleton.d.ts +1 -1
- package/lib/components/ClassPrefix/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/DataTable/Table.d.ts +1 -1
- package/lib/components/DataTable/TableBatchAction.d.ts +1 -1
- package/lib/components/DataTable/TableBody.d.ts +1 -1
- package/lib/components/DataTable/TableContainer.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandedRow.d.ts +1 -1
- package/lib/components/DataTable/TableRow.d.ts +1 -1
- package/lib/components/DataTable/TableSelectAll.d.ts +1 -1
- package/lib/components/DataTable/TableSelectRow.d.ts +1 -1
- package/lib/components/DataTable/TableSlugRow.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +3 -3
- package/lib/components/DatePicker/DatePicker.Skeleton.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +1 -3
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +1 -2
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/lib/components/FileUploader/Filename.d.ts +1 -1
- package/lib/components/Form/Form.d.ts +1 -1
- package/lib/components/FormGroup/FormGroup.d.ts +1 -1
- package/lib/components/FormItem/FormItem.d.ts +1 -1
- package/lib/components/FormLabel/FormLabel.d.ts +1 -1
- package/lib/components/Heading/index.d.ts +5 -5
- package/lib/components/Icon/Icon.Skeleton.d.ts +1 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/lib/components/ListBox/ListBoxMenu.d.ts +1 -0
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/Loading/Loading.d.ts +1 -2
- package/lib/components/Loading/Loading.js +2 -2
- package/lib/components/Menu/Menu.d.ts +59 -0
- package/lib/components/Menu/Menu.js +33 -10
- package/lib/components/Menu/MenuContext.d.ts +32 -0
- package/lib/components/Menu/MenuItem.d.ts +119 -0
- package/lib/components/Menu/MenuItem.js +17 -12
- package/lib/components/Menu/index.d.ts +9 -0
- package/lib/components/MenuButton/index.js +1 -0
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +1 -1
- package/lib/components/Notification/Notification.d.ts +8 -6
- package/lib/components/Notification/Notification.js +2 -1
- package/lib/components/NumberInput/NumberInput.Skeleton.d.ts +1 -1
- package/lib/components/OrderedList/OrderedList.d.ts +1 -1
- package/lib/components/OverflowMenu/next/index.js +1 -0
- package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/lib/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.Skeleton.d.ts +1 -1
- package/lib/components/Search/Search.Skeleton.d.ts +1 -1
- package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/lib/components/Select/Select.Skeleton.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/SelectItem/SelectItem.d.ts +1 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +1 -1
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +1 -1
- package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/lib/components/Slider/Slider.Skeleton.d.ts +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/SliderHandles.d.ts +4 -4
- package/lib/components/Stack/index.d.ts +4 -3
- package/lib/components/StructuredList/StructuredList.Skeleton.d.ts +1 -2
- package/lib/components/StructuredList/StructuredList.d.ts +6 -6
- package/lib/components/TabContent/TabContent.d.ts +1 -1
- package/lib/components/Tabs/Tabs.Skeleton.d.ts +1 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -3
- package/lib/components/Tag/Tag.Skeleton.d.ts +1 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/Text/createTextComponent.d.ts +1 -1
- package/lib/components/Text/index.d.ts +2 -2
- package/lib/components/TextArea/TextArea.Skeleton.d.ts +1 -1
- package/lib/components/TextInput/TextInput.Skeleton.d.ts +1 -1
- package/lib/components/Theme/index.d.ts +4 -2
- package/lib/components/TileGroup/TileGroup.d.ts +1 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/Toggletip/index.d.ts +5 -5
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +2 -2
- package/lib/components/UIShell/Content.d.ts +61 -49
- package/lib/components/UIShell/HeaderContainer.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -1
- package/lib/components/UIShell/HeaderName.d.ts +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +1 -1
- package/lib/components/UIShell/HeaderSideNavItems.d.ts +1 -1
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +1 -1
- package/lib/components/UIShell/SideNavFooter.d.ts +1 -1
- package/lib/components/UIShell/SideNavLinkText.d.ts +1 -1
- package/lib/components/UIShell/SkipToContent.d.ts +1 -1
- package/lib/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/lib/index.js +8 -8
- package/package.json +7 -7
|
@@ -66,7 +66,7 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
66
66
|
dispatch: childDispatch
|
|
67
67
|
};
|
|
68
68
|
}, [childState, childDispatch]);
|
|
69
|
-
const menu = React.useRef();
|
|
69
|
+
const menu = React.useRef(null);
|
|
70
70
|
const ref = useMergedRefs.useMergedRefs([forwardRef, menu]);
|
|
71
71
|
const [position, setPosition] = React.useState([-1, -1]);
|
|
72
72
|
const focusableItems = childContext.state.items.filter(item => !item.disabled && item.ref.current);
|
|
@@ -154,11 +154,14 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function handleBlur(e) {
|
|
157
|
-
if (open && onClose && isRoot && !menu.current
|
|
157
|
+
if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
|
|
158
158
|
handleClose(e);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function fitValue(range, axis) {
|
|
162
|
+
if (!menu.current) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
162
165
|
const {
|
|
163
166
|
width,
|
|
164
167
|
height
|
|
@@ -197,18 +200,38 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
197
200
|
reversedAnchor - size >= 0 ? reversedAnchor - size + offset : false,
|
|
198
201
|
// align at max (second fallback)
|
|
199
202
|
max - spacing - size];
|
|
203
|
+
|
|
204
|
+
// Previous array `options`, has at least one item that is a number (the last one - second fallback).
|
|
205
|
+
// That guarantees that the return of `find()` will always be a number
|
|
206
|
+
// and we can safely add the numeric casting `as number`.
|
|
200
207
|
const bestOption = options.find(option => option !== false);
|
|
201
208
|
return bestOption >= spacing ? bestOption : spacing;
|
|
202
209
|
}
|
|
210
|
+
function notEmpty(value) {
|
|
211
|
+
return value !== null && value !== undefined;
|
|
212
|
+
}
|
|
213
|
+
function getPosition(x) {
|
|
214
|
+
if (Array.isArray(x)) {
|
|
215
|
+
// has to be of length 2
|
|
216
|
+
const filtered = x.filter(notEmpty);
|
|
217
|
+
if (filtered.length === 2) {
|
|
218
|
+
return filtered;
|
|
219
|
+
} else {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
return [x, x];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
203
226
|
function calculatePosition() {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return [
|
|
227
|
+
const ranges = {
|
|
228
|
+
x: getPosition(x),
|
|
229
|
+
y: getPosition(y)
|
|
230
|
+
};
|
|
231
|
+
if (!ranges.x || !ranges.y) {
|
|
232
|
+
return [-1, -1];
|
|
210
233
|
}
|
|
211
|
-
return [-1, -1];
|
|
234
|
+
return [fitValue(ranges.x, 'x') ?? -1, fitValue(ranges.y, 'y') ?? -1];
|
|
212
235
|
}
|
|
213
236
|
React.useEffect(() => {
|
|
214
237
|
if (open && focusableItems.length > 0) {
|
|
@@ -222,7 +245,7 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
222
245
|
} else {
|
|
223
246
|
// reset position when menu is closed in order for the --shown
|
|
224
247
|
// modifier to be applied correctly
|
|
225
|
-
setPosition(-1, -1);
|
|
248
|
+
setPosition([-1, -1]);
|
|
226
249
|
}
|
|
227
250
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
228
251
|
}, [open]);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 };
|
|
@@ -0,0 +1,119 @@
|
|
|
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, };
|
|
@@ -49,7 +49,7 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
49
49
|
} = _ref;
|
|
50
50
|
const prefix = usePrefix.usePrefix();
|
|
51
51
|
const context = React.useContext(MenuContext.MenuContext);
|
|
52
|
-
const menuItem = React.useRef();
|
|
52
|
+
const menuItem = React.useRef(null);
|
|
53
53
|
const ref = useMergedRefs.useMergedRefs([forwardRef, menuItem]);
|
|
54
54
|
const [boundaries, setBoundaries] = React.useState({
|
|
55
55
|
x: -1,
|
|
@@ -71,6 +71,9 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
function openSubmenu() {
|
|
74
|
+
if (!menuItem.current) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
74
77
|
const {
|
|
75
78
|
x,
|
|
76
79
|
y,
|
|
@@ -115,9 +118,11 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
115
118
|
}, hoverIntentDelay);
|
|
116
119
|
}
|
|
117
120
|
function handleMouseLeave() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
if (hoverIntentTimeout.current) {
|
|
122
|
+
clearTimeout(hoverIntentTimeout.current);
|
|
123
|
+
closeSubmenu();
|
|
124
|
+
menuItem.current?.focus();
|
|
125
|
+
}
|
|
121
126
|
}
|
|
122
127
|
function handleKeyDown(e) {
|
|
123
128
|
if (hasChildren && match.match(e, keys.ArrowRight)) {
|
|
@@ -167,13 +172,13 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
167
172
|
}, rest, {
|
|
168
173
|
ref: ref,
|
|
169
174
|
className: classNames,
|
|
170
|
-
tabIndex:
|
|
171
|
-
"aria-disabled": isDisabled
|
|
172
|
-
"aria-haspopup": hasChildren ||
|
|
173
|
-
"aria-expanded": hasChildren ? submenuOpen :
|
|
175
|
+
tabIndex: -1,
|
|
176
|
+
"aria-disabled": isDisabled,
|
|
177
|
+
"aria-haspopup": hasChildren || undefined,
|
|
178
|
+
"aria-expanded": hasChildren ? submenuOpen : undefined,
|
|
174
179
|
onClick: handleClick,
|
|
175
|
-
onMouseEnter: hasChildren ? handleMouseEnter :
|
|
176
|
-
onMouseLeave: hasChildren ? handleMouseLeave :
|
|
180
|
+
onMouseEnter: hasChildren ? handleMouseEnter : undefined,
|
|
181
|
+
onMouseLeave: hasChildren ? handleMouseLeave : undefined,
|
|
177
182
|
onKeyDown: handleKeyDown
|
|
178
183
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
179
184
|
className: `${prefix}--menu-item__icon`
|
|
@@ -190,7 +195,7 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
190
195
|
open: submenuOpen,
|
|
191
196
|
onClose: () => {
|
|
192
197
|
closeSubmenu();
|
|
193
|
-
menuItem.current
|
|
198
|
+
menuItem.current?.focus();
|
|
194
199
|
},
|
|
195
200
|
x: boundaries.x,
|
|
196
201
|
y: boundaries.y
|
|
@@ -370,7 +375,7 @@ const MenuItemRadioGroup = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
|
370
375
|
}, /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
371
376
|
role: "group",
|
|
372
377
|
"aria-label": label
|
|
373
|
-
}), items
|
|
378
|
+
}), items?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(MenuItem, {
|
|
374
379
|
key: i,
|
|
375
380
|
label: itemToString(item),
|
|
376
381
|
role: "menuitemradio",
|
|
@@ -0,0 +1,9 @@
|
|
|
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, };
|
|
@@ -17,6 +17,7 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
17
17
|
var Button = require('../Button/Button.js');
|
|
18
18
|
require('../Button/Button.Skeleton.js');
|
|
19
19
|
var Menu = require('../Menu/Menu.js');
|
|
20
|
+
require('../Menu/MenuItem.js');
|
|
20
21
|
var useAttachedMenu = require('../../internal/useAttachedMenu.js');
|
|
21
22
|
var useId = require('../../internal/useId.js');
|
|
22
23
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
@@ -70,6 +70,6 @@ export default class ModalWrapper extends React.Component<ModalWrapperProps, Mod
|
|
|
70
70
|
handleOpen: () => void;
|
|
71
71
|
handleClose: (evt: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
72
72
|
handleOnRequestSubmit: (evt: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
73
|
-
render(): JSX.Element;
|
|
73
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
74
74
|
}
|
|
75
75
|
export {};
|
|
@@ -25,7 +25,7 @@ export interface NotificationActionButtonProps extends ButtonProps<'button'> {
|
|
|
25
25
|
*/
|
|
26
26
|
onClick?(): void;
|
|
27
27
|
}
|
|
28
|
-
export declare function NotificationActionButton({ children, className: customClassName, onClick, inline, ...rest }: NotificationActionButtonProps): JSX.Element;
|
|
28
|
+
export declare function NotificationActionButton({ children, className: customClassName, onClick, inline, ...rest }: NotificationActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export declare namespace NotificationActionButton {
|
|
30
30
|
var propTypes: {
|
|
31
31
|
/**
|
|
@@ -82,7 +82,7 @@ export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButton
|
|
|
82
82
|
name?: string;
|
|
83
83
|
}>;
|
|
84
84
|
}
|
|
85
|
-
export declare function NotificationButton({ 'aria-label': ariaLabel, ariaLabel: deprecatedAriaLabel, className, type, renderIcon: IconTag, name, notificationType, ...rest }: NotificationButtonProps): JSX.Element;
|
|
85
|
+
export declare function NotificationButton({ 'aria-label': ariaLabel, ariaLabel: deprecatedAriaLabel, className, type, renderIcon: IconTag, name, notificationType, ...rest }: NotificationButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
86
86
|
export declare namespace NotificationButton {
|
|
87
87
|
var propTypes: {
|
|
88
88
|
/**
|
|
@@ -186,7 +186,7 @@ export interface ToastNotificationProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
186
186
|
*/
|
|
187
187
|
title?: string;
|
|
188
188
|
}
|
|
189
|
-
export declare function ToastNotification({ ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, role, onClose, onCloseButtonClick, statusIconDescription, className, children, kind, lowContrast, hideCloseButton, timeout, title, caption, subtitle, ...rest }: ToastNotificationProps): JSX.Element | null;
|
|
189
|
+
export declare function ToastNotification({ ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, role, onClose, onCloseButtonClick, statusIconDescription, className, children, kind, lowContrast, hideCloseButton, timeout, title, caption, subtitle, ...rest }: ToastNotificationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
190
190
|
export declare namespace ToastNotification {
|
|
191
191
|
var propTypes: {
|
|
192
192
|
/**
|
|
@@ -308,7 +308,7 @@ export interface InlineNotificationProps extends HTMLAttributes<HTMLDivElement>
|
|
|
308
308
|
*/
|
|
309
309
|
title?: string;
|
|
310
310
|
}
|
|
311
|
-
export declare function InlineNotification({ ['aria-label']: ariaLabel, children, title, subtitle, role, onClose, onCloseButtonClick, statusIconDescription, className, kind, lowContrast, hideCloseButton, ...rest }: InlineNotificationProps): JSX.Element | null;
|
|
311
|
+
export declare function InlineNotification({ ['aria-label']: ariaLabel, children, title, subtitle, role, onClose, onCloseButtonClick, statusIconDescription, className, kind, lowContrast, hideCloseButton, ...rest }: InlineNotificationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
312
312
|
export declare namespace InlineNotification {
|
|
313
313
|
var propTypes: {
|
|
314
314
|
/**
|
|
@@ -388,6 +388,7 @@ export interface ActionableNotificationProps extends HTMLAttributes<HTMLDivEleme
|
|
|
388
388
|
*/
|
|
389
389
|
closeOnEscape?: boolean;
|
|
390
390
|
/**
|
|
391
|
+
* @deprecated use StaticNotification once it's available. Issue #15532
|
|
391
392
|
* Specify if focus should be moved to the component when the notification contains actions
|
|
392
393
|
*/
|
|
393
394
|
hasFocus?: boolean;
|
|
@@ -435,7 +436,7 @@ export interface ActionableNotificationProps extends HTMLAttributes<HTMLDivEleme
|
|
|
435
436
|
*/
|
|
436
437
|
title?: string;
|
|
437
438
|
}
|
|
438
|
-
export declare function ActionableNotification({ actionButtonLabel, ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, children, role, onActionButtonClick, onClose, onCloseButtonClick, statusIconDescription, className, inline, kind, lowContrast, hideCloseButton, hasFocus, closeOnEscape, title, subtitle, ...rest }: ActionableNotificationProps): JSX.Element | null;
|
|
439
|
+
export declare function ActionableNotification({ actionButtonLabel, ['aria-label']: ariaLabel, ariaLabel: deprecatedAriaLabel, children, role, onActionButtonClick, onClose, onCloseButtonClick, statusIconDescription, className, inline, kind, lowContrast, hideCloseButton, hasFocus, closeOnEscape, title, subtitle, ...rest }: ActionableNotificationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
439
440
|
export declare namespace ActionableNotification {
|
|
440
441
|
var propTypes: {
|
|
441
442
|
/**
|
|
@@ -464,9 +465,10 @@ export declare namespace ActionableNotification {
|
|
|
464
465
|
*/
|
|
465
466
|
closeOnEscape: PropTypes.Requireable<boolean>;
|
|
466
467
|
/**
|
|
468
|
+
* Deprecated, please use StaticNotification once it's available. Issue #15532
|
|
467
469
|
* Specify if focus should be moved to the component when the notification contains actions
|
|
468
470
|
*/
|
|
469
|
-
hasFocus:
|
|
471
|
+
hasFocus: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
|
|
470
472
|
/**
|
|
471
473
|
* Specify the close button should be disabled, or not
|
|
472
474
|
*/
|
|
@@ -637,9 +637,10 @@ ActionableNotification.propTypes = {
|
|
|
637
637
|
*/
|
|
638
638
|
closeOnEscape: PropTypes__default["default"].bool,
|
|
639
639
|
/**
|
|
640
|
+
* Deprecated, please use StaticNotification once it's available. Issue #15532
|
|
640
641
|
* Specify if focus should be moved to the component when the notification contains actions
|
|
641
642
|
*/
|
|
642
|
-
hasFocus: PropTypes__default["default"].bool,
|
|
643
|
+
hasFocus: deprecate["default"](PropTypes__default["default"].bool),
|
|
643
644
|
/**
|
|
644
645
|
* Specify the close button should be disabled, or not
|
|
645
646
|
*/
|
|
@@ -16,7 +16,7 @@ export interface NumberInputSkeletonProps extends HTMLAttributes<HTMLDivElement>
|
|
|
16
16
|
*/
|
|
17
17
|
hideLabel?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare function NumberInputSkeleton({ hideLabel, className, ...rest }: NumberInputSkeletonProps): JSX.Element;
|
|
19
|
+
declare function NumberInputSkeleton({ hideLabel, className, ...rest }: NumberInputSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare namespace NumberInputSkeleton {
|
|
21
21
|
var propTypes: {
|
|
22
22
|
/**
|
|
@@ -11,7 +11,7 @@ interface OrderedListProps extends ComponentProps<'ol'> {
|
|
|
11
11
|
native?: boolean | undefined;
|
|
12
12
|
isExpressive?: boolean | undefined;
|
|
13
13
|
}
|
|
14
|
-
declare function OrderedList({ className, nested, native, isExpressive, ...other }: OrderedListProps): JSX.Element;
|
|
14
|
+
declare function OrderedList({ className, nested, native, isExpressive, ...other }: OrderedListProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
declare namespace OrderedList {
|
|
16
16
|
var propTypes: {
|
|
17
17
|
/**
|
|
@@ -16,6 +16,7 @@ var cx = require('classnames');
|
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
17
17
|
var index = require('../../IconButton/index.js');
|
|
18
18
|
var Menu = require('../../Menu/Menu.js');
|
|
19
|
+
require('../../Menu/MenuItem.js');
|
|
19
20
|
var useId = require('../../../internal/useId.js');
|
|
20
21
|
var usePrefix = require('../../../internal/usePrefix.js');
|
|
21
22
|
var useAttachedMenu = require('../../../internal/useAttachedMenu.js');
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const PrimaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => JSX.Element;
|
|
9
|
+
declare const PrimaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default PrimaryButton;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
interface ProgressBarProps {
|
|
10
9
|
/**
|
|
@@ -44,7 +43,7 @@ interface ProgressBarProps {
|
|
|
44
43
|
*/
|
|
45
44
|
value?: number;
|
|
46
45
|
}
|
|
47
|
-
declare function ProgressBar({ className, helperText, hideLabel, label, max, size, status, type, value, }: ProgressBarProps): JSX.Element;
|
|
46
|
+
declare function ProgressBar({ className, helperText, hideLabel, label, max, size, status, type, value, }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
48
47
|
declare namespace ProgressBar {
|
|
49
48
|
var propTypes: {
|
|
50
49
|
/**
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
interface ProgressIndicatorSkeletonProps {
|
|
10
9
|
/**
|
|
@@ -16,7 +15,7 @@ interface ProgressIndicatorSkeletonProps {
|
|
|
16
15
|
*/
|
|
17
16
|
vertical?: boolean;
|
|
18
17
|
}
|
|
19
|
-
declare function ProgressIndicatorSkeleton({ className, vertical, ...rest }: ProgressIndicatorSkeletonProps): JSX.Element;
|
|
18
|
+
declare function ProgressIndicatorSkeleton({ className, vertical, ...rest }: ProgressIndicatorSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
declare namespace ProgressIndicatorSkeleton {
|
|
21
20
|
var propTypes: {
|
|
22
21
|
/**
|
|
@@ -33,7 +33,7 @@ interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElem
|
|
|
33
33
|
*/
|
|
34
34
|
vertical?: boolean;
|
|
35
35
|
}
|
|
36
|
-
declare function ProgressIndicator({ children, className: customClassName, currentIndex: controlledIndex, onChange, spaceEqually, vertical, ...rest }: ProgressIndicatorProps): JSX.Element;
|
|
36
|
+
declare function ProgressIndicator({ children, className: customClassName, currentIndex: controlledIndex, onChange, spaceEqually, vertical, ...rest }: ProgressIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
declare namespace ProgressIndicator {
|
|
38
38
|
var propTypes: {
|
|
39
39
|
/**
|
|
@@ -118,7 +118,7 @@ interface ProgressStepProps {
|
|
|
118
118
|
*/
|
|
119
119
|
translateWithId?: (id: string) => string;
|
|
120
120
|
}
|
|
121
|
-
declare function ProgressStep({ label, description, className, current, complete, invalid, secondaryLabel, disabled, onClick, translateWithId: t, ...rest }: ProgressStepProps): JSX.Element;
|
|
121
|
+
declare function ProgressStep({ label, description, className, current, complete, invalid, secondaryLabel, disabled, onClick, translateWithId: t, ...rest }: ProgressStepProps): import("react/jsx-runtime").JSX.Element;
|
|
122
122
|
declare namespace ProgressStep {
|
|
123
123
|
var propTypes: {
|
|
124
124
|
/**
|
|
@@ -12,7 +12,7 @@ export interface RadioButtonSkeletonProps extends React.InputHTMLAttributes<HTML
|
|
|
12
12
|
*/
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
|
-
declare function RadioButtonSkeleton(props: RadioButtonSkeletonProps): JSX.Element;
|
|
15
|
+
declare function RadioButtonSkeleton(props: RadioButtonSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
declare namespace RadioButtonSkeleton {
|
|
17
17
|
var propTypes: {
|
|
18
18
|
/**
|
|
@@ -17,7 +17,7 @@ export interface SearchSkeletonProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
17
17
|
small?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const SearchSkeleton: {
|
|
20
|
-
({ small, className, ...rest }: SearchSkeletonProps): JSX.Element;
|
|
20
|
+
({ small, className, ...rest }: SearchSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
propTypes: {
|
|
22
22
|
/**
|
|
23
23
|
* Specify an optional className to add.
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const SecondaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => JSX.Element;
|
|
9
|
+
declare const SecondaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default SecondaryButton;
|
|
@@ -17,7 +17,7 @@ export interface SelectSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
17
17
|
hideLabel?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const SelectSkeleton: {
|
|
20
|
-
({ hideLabel, className, ...rest }: SelectSkeletonProps): JSX.Element;
|
|
20
|
+
({ hideLabel, className, ...rest }: SelectSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
propTypes: {
|
|
22
22
|
/**
|
|
23
23
|
* Specify an optional className to add to the form item wrapper.
|
|
@@ -90,5 +90,5 @@ interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, ExcludedAttr
|
|
|
90
90
|
*/
|
|
91
91
|
warnText?: ReactNode;
|
|
92
92
|
}
|
|
93
|
-
declare const Select: React.ForwardRefExoticComponent<
|
|
93
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
94
94
|
export default Select;
|
|
@@ -29,7 +29,7 @@ export interface SelectItemProps extends HTMLAttributes<HTMLOptionElement> {
|
|
|
29
29
|
value: any;
|
|
30
30
|
}
|
|
31
31
|
declare const SelectItem: {
|
|
32
|
-
({ className, value, disabled, hidden, text, ...other }: SelectItemProps): JSX.Element;
|
|
32
|
+
({ className, value, disabled, hidden, text, ...other }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
propTypes: {
|
|
34
34
|
/**
|
|
35
35
|
* Specify an optional className to be applied to the node
|
|
@@ -25,7 +25,7 @@ export interface SelectItemGroupProps extends HTMLAttributes<HTMLOptGroupElement
|
|
|
25
25
|
label: string;
|
|
26
26
|
}
|
|
27
27
|
declare const SelectItemGroup: {
|
|
28
|
-
({ children, className, disabled, label, ...other }: SelectItemGroupProps): JSX.Element;
|
|
28
|
+
({ children, className, disabled, label, ...other }: SelectItemGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
propTypes: {
|
|
30
30
|
/**
|
|
31
31
|
* Provide the contents of your <SelectItemGroup>
|
|
@@ -12,7 +12,7 @@ export interface SkeletonPlaceholderProps {
|
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
14
|
declare const SkeletonPlaceholder: {
|
|
15
|
-
({ className, ...other }: SkeletonPlaceholderProps): JSX.Element;
|
|
15
|
+
({ className, ...other }: SkeletonPlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
propTypes: {
|
|
17
17
|
/**
|
|
18
18
|
* Add a custom class to the component
|
|
@@ -28,7 +28,7 @@ interface SkeletonTextProps {
|
|
|
28
28
|
width?: string;
|
|
29
29
|
}
|
|
30
30
|
declare const SkeletonText: {
|
|
31
|
-
({ paragraph, lineCount, width, heading, className, ...rest }: SkeletonTextProps): JSX.Element;
|
|
31
|
+
({ paragraph, lineCount, width, heading, className, ...rest }: SkeletonTextProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
propTypes: {
|
|
33
33
|
/**
|
|
34
34
|
* Specify an optional className to be applied to the container node
|
|
@@ -21,7 +21,7 @@ export interface SliderSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
21
21
|
twoHandles?: boolean;
|
|
22
22
|
}
|
|
23
23
|
declare const SliderSkeleton: {
|
|
24
|
-
({ hideLabel, className, twoHandles, ...rest }: SliderSkeletonProps): JSX.Element;
|
|
24
|
+
({ hideLabel, className, twoHandles, ...rest }: SliderSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
propTypes: {
|
|
26
26
|
/**
|
|
27
27
|
* Specify an optional className to add to the form item wrapper.
|
|
@@ -492,6 +492,6 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
492
492
|
getClientXFromEvent(event: MouseEvent | TouchEvent): any;
|
|
493
493
|
hasTwoHandles(): boolean;
|
|
494
494
|
static getDerivedStateFromProps(props: any, state: any): {} | null;
|
|
495
|
-
render(): JSX.Element;
|
|
495
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
496
496
|
}
|
|
497
497
|
export default Slider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LowerHandle: () => JSX.Element;
|
|
2
|
-
export declare const LowerHandleFocus: () => JSX.Element;
|
|
3
|
-
export declare const UpperHandle: () => JSX.Element;
|
|
4
|
-
export declare const UpperHandleFocus: () => JSX.Element;
|
|
1
|
+
export declare const LowerHandle: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const LowerHandleFocus: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const UpperHandle: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const UpperHandleFocus: () => import("react/jsx-runtime").JSX.Element;
|