@carbon/react 1.39.0 → 1.41.0-rc.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 +2755 -901
- package/es/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -5
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/es/components/Checkbox/Checkbox.js +3 -6
- package/es/components/CodeSnippet/CodeSnippet.js +5 -12
- package/es/components/ComboBox/ComboBox.d.ts +1 -5
- package/es/components/ComboBox/ComboBox.js +6 -20
- package/es/components/ComposedModal/ComposedModal.js +1 -4
- package/es/components/ComposedModal/ModalFooter.js +4 -9
- package/es/components/ComposedModal/ModalHeader.js +1 -4
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/es/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/es/components/Copy/Copy.js +4 -8
- package/es/components/CopyButton/CopyButton.js +8 -7
- package/es/components/DataTable/DataTable.d.ts +3 -39
- package/es/components/DataTable/DataTable.js +10 -18
- package/es/components/DataTable/Table.d.ts +0 -4
- package/es/components/DataTable/Table.js +0 -4
- package/es/components/DataTable/TableBatchAction.js +12 -5
- package/es/components/DataTable/TableBatchActions.js +1 -6
- package/es/components/DataTable/TableBody.d.ts +0 -3
- package/es/components/DataTable/TableBody.js +1 -3
- package/es/components/DataTable/TableHeader.js +3 -8
- package/es/components/DataTable/TableSelectAll.d.ts +0 -3
- package/es/components/DataTable/TableSelectAll.js +2 -4
- package/es/components/DataTable/TableSelectRow.js +2 -1
- package/es/components/DataTable/TableToolbar.d.ts +10 -0
- package/es/components/DataTable/TableToolbar.js +15 -7
- package/es/components/DataTable/TableToolbarMenu.js +2 -6
- package/es/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/es/components/DataTable/TableToolbarSearch.js +6 -11
- package/es/components/DataTable/tools/sorting.js +2 -2
- package/es/components/DatePicker/DatePicker.d.ts +4 -4
- package/es/components/DatePicker/DatePicker.js +9 -4
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/es/components/DatePickerInput/DatePickerInput.js +12 -6
- package/es/components/Dropdown/Dropdown.js +6 -15
- package/es/components/FileUploader/FileUploader.d.ts +2 -11
- package/es/components/FileUploader/FileUploader.js +15 -19
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/es/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/es/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/es/components/FileUploader/FileUploaderItem.js +42 -12
- package/es/components/FileUploader/Filename.d.ts +6 -10
- package/es/components/FileUploader/Filename.js +9 -12
- package/es/components/FormGroup/FormGroup.d.ts +0 -5
- package/es/components/FormGroup/FormGroup.js +3 -8
- package/es/components/FormItem/FormItem.d.ts +32 -0
- package/es/components/FormItem/index.d.ts +9 -0
- package/es/components/FormLabel/FormLabel.js +4 -1
- package/es/components/ListBox/ListBox.js +4 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/es/components/ListBox/ListBoxMenuItem.js +4 -8
- package/es/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/es/components/ListBox/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/ListItem/ListItem.js +6 -2
- package/es/components/Menu/MenuItem.js +4 -1
- package/es/components/Modal/Modal.js +16 -27
- package/es/components/ModalWrapper/ModalWrapper.js +13 -19
- package/es/components/MultiSelect/FilterableMultiSelect.js +14 -28
- package/es/components/MultiSelect/MultiSelect.js +17 -33
- package/es/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/es/components/MultiSelect/tools/sorting.js +2 -2
- package/es/components/Notification/Notification.d.ts +11 -29
- package/es/components/Notification/Notification.js +38 -57
- package/es/components/NumberInput/NumberInput.js +6 -2
- package/es/components/OverflowMenu/OverflowMenu.js +27 -33
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/es/components/Pagination/experimental/PageSelector.js +3 -8
- package/es/components/Pagination/experimental/Pagination.js +16 -34
- package/es/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/es/components/RadioTile/RadioTile.js +6 -7
- package/es/components/Search/Search.Skeleton.d.ts +0 -3
- package/es/components/Search/Search.Skeleton.js +1 -4
- package/es/components/Search/Search.js +1 -1
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +13 -16
- package/es/components/SelectItem/SelectItem.d.ts +0 -6
- package/es/components/SelectItem/SelectItem.js +4 -10
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/es/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/es/components/SkeletonText/SkeletonText.js +0 -6
- package/es/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/es/components/Slider/Slider.Skeleton.js +20 -4
- package/es/components/Slider/Slider.d.ts +137 -25
- package/es/components/Slider/Slider.js +779 -186
- package/es/components/StructuredList/StructuredList.js +5 -2
- package/es/components/Switch/Switch.js +3 -7
- package/es/components/Tabs/Tabs.js +5 -2
- package/es/components/Tag/Tag.js +4 -2
- package/es/components/Text/Text.js +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/TextArea/TextArea.js +30 -34
- package/es/components/TextInput/ControlledPasswordInput.js +12 -19
- package/es/components/TextInput/TextInput.js +8 -3
- package/es/components/Tile/Tile.js +4 -2
- package/es/components/TileGroup/TileGroup.js +5 -4
- package/es/components/Toggle/Toggle.js +4 -2
- package/es/components/UIShell/Content.js +1 -4
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +32 -0
- package/es/components/UIShell/SideNavDetails.js +1 -2
- package/es/components/UIShell/SideNavDivider.d.ts +15 -0
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -5
- package/es/components/UIShell/SideNavIcon.d.ts +25 -0
- package/es/components/UIShell/SideNavIcon.js +4 -7
- package/es/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/es/components/UIShell/SideNavLinkText.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +46 -0
- package/es/components/UIShell/SideNavMenu.js +23 -13
- package/es/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/es/components/UIShell/SideNavSwitcher.js +6 -5
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +2 -7
- package/es/internal/Selection.js +0 -3
- package/es/internal/noopFn.d.ts +7 -0
- package/es/internal/noopFn.js +10 -0
- package/es/internal/useNormalizedInputProps.js +6 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/lib/components/Checkbox/Checkbox.js +3 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +5 -12
- package/lib/components/ComboBox/ComboBox.d.ts +1 -5
- package/lib/components/ComboBox/ComboBox.js +5 -19
- package/lib/components/ComposedModal/ComposedModal.js +1 -4
- package/lib/components/ComposedModal/ModalFooter.js +4 -9
- package/lib/components/ComposedModal/ModalHeader.js +1 -4
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/lib/components/Copy/Copy.js +4 -8
- package/lib/components/CopyButton/CopyButton.js +8 -7
- package/lib/components/DataTable/DataTable.d.ts +3 -39
- package/lib/components/DataTable/DataTable.js +13 -21
- package/lib/components/DataTable/Table.d.ts +0 -4
- package/lib/components/DataTable/Table.js +0 -4
- package/lib/components/DataTable/TableBatchAction.js +12 -5
- package/lib/components/DataTable/TableBatchActions.js +1 -6
- package/lib/components/DataTable/TableBody.d.ts +0 -3
- package/lib/components/DataTable/TableBody.js +1 -3
- package/lib/components/DataTable/TableHeader.js +3 -8
- package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
- package/lib/components/DataTable/TableSelectAll.js +2 -4
- package/lib/components/DataTable/TableSelectRow.js +2 -1
- package/lib/components/DataTable/TableToolbar.d.ts +10 -0
- package/lib/components/DataTable/TableToolbar.js +15 -7
- package/lib/components/DataTable/TableToolbarMenu.js +2 -6
- package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/lib/components/DataTable/TableToolbarSearch.js +6 -11
- package/lib/components/DataTable/tools/sorting.js +2 -2
- package/lib/components/DatePicker/DatePicker.d.ts +4 -4
- package/lib/components/DatePicker/DatePicker.js +9 -4
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +12 -6
- package/lib/components/Dropdown/Dropdown.js +6 -15
- package/lib/components/FileUploader/FileUploader.d.ts +2 -11
- package/lib/components/FileUploader/FileUploader.js +15 -19
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/lib/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/lib/components/FileUploader/FileUploaderItem.js +41 -11
- package/lib/components/FileUploader/Filename.d.ts +6 -10
- package/lib/components/FileUploader/Filename.js +9 -12
- package/lib/components/FormGroup/FormGroup.d.ts +0 -5
- package/lib/components/FormGroup/FormGroup.js +3 -8
- package/lib/components/FormItem/FormItem.d.ts +32 -0
- package/lib/components/FormItem/index.d.ts +9 -0
- package/lib/components/FormLabel/FormLabel.js +4 -1
- package/lib/components/ListBox/ListBox.js +4 -8
- package/lib/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -8
- package/lib/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/lib/components/ListBox/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/ListItem/ListItem.js +6 -2
- package/lib/components/Menu/MenuItem.js +4 -1
- package/lib/components/Modal/Modal.js +16 -27
- package/lib/components/ModalWrapper/ModalWrapper.js +13 -19
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -32
- package/lib/components/MultiSelect/MultiSelect.js +16 -32
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/lib/components/MultiSelect/tools/sorting.js +2 -2
- package/lib/components/Notification/Notification.d.ts +11 -29
- package/lib/components/Notification/Notification.js +38 -57
- package/lib/components/NumberInput/NumberInput.js +6 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +27 -33
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/lib/components/Pagination/experimental/PageSelector.js +3 -8
- package/lib/components/Pagination/experimental/Pagination.js +16 -34
- package/lib/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/lib/components/RadioTile/RadioTile.js +6 -7
- package/lib/components/Search/Search.Skeleton.d.ts +0 -3
- package/lib/components/Search/Search.Skeleton.js +1 -4
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +13 -16
- package/lib/components/SelectItem/SelectItem.d.ts +0 -6
- package/lib/components/SelectItem/SelectItem.js +4 -10
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/lib/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/lib/components/SkeletonText/SkeletonText.js +0 -6
- package/lib/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/lib/components/Slider/Slider.Skeleton.js +20 -4
- package/lib/components/Slider/Slider.d.ts +137 -25
- package/lib/components/Slider/Slider.js +778 -185
- package/lib/components/StructuredList/StructuredList.js +5 -2
- package/lib/components/Switch/Switch.js +3 -7
- package/lib/components/Tabs/Tabs.js +5 -2
- package/lib/components/Tag/Tag.js +4 -2
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/TextArea/TextArea.js +30 -34
- package/lib/components/TextInput/ControlledPasswordInput.js +12 -19
- package/lib/components/TextInput/TextInput.js +8 -3
- package/lib/components/Tile/Tile.js +4 -2
- package/lib/components/TileGroup/TileGroup.js +5 -4
- package/lib/components/Toggle/Toggle.js +4 -2
- package/lib/components/UIShell/Content.js +1 -4
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +32 -0
- package/lib/components/UIShell/SideNavDetails.js +1 -2
- package/lib/components/UIShell/SideNavDivider.d.ts +15 -0
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -5
- package/lib/components/UIShell/SideNavIcon.d.ts +25 -0
- package/lib/components/UIShell/SideNavIcon.js +4 -7
- package/lib/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/lib/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/components/UIShell/SideNavMenu.d.ts +46 -0
- package/lib/components/UIShell/SideNavMenu.js +23 -13
- package/lib/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/lib/components/UIShell/SideNavSwitcher.js +5 -4
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +2 -7
- package/lib/internal/Selection.js +0 -3
- package/lib/internal/noopFn.d.ts +7 -0
- package/lib/internal/noopFn.js +14 -0
- package/lib/internal/useNormalizedInputProps.js +6 -2
- package/package.json +10 -9
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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 SideNavIconProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
11
|
+
* container
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provide an optional class to be applied to the containing node
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify whether the icon should be placed in a smaller bounding box
|
|
20
|
+
* Since the 'small' prop is not provided, we make it optional and set a default value to `false`.
|
|
21
|
+
*/
|
|
22
|
+
small?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const SideNavIcon: React.FC<SideNavIconProps>;
|
|
25
|
+
export default SideNavIcon;
|
|
@@ -10,11 +10,11 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const SideNavIcon = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
children,
|
|
16
16
|
className: customClassName,
|
|
17
|
-
small
|
|
17
|
+
small = false
|
|
18
18
|
} = _ref;
|
|
19
19
|
const prefix = usePrefix();
|
|
20
20
|
const className = cx({
|
|
@@ -25,7 +25,7 @@ function SideNavIcon(_ref) {
|
|
|
25
25
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
26
26
|
className: className
|
|
27
27
|
}, children);
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
SideNavIcon.propTypes = {
|
|
30
30
|
/**
|
|
31
31
|
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
@@ -39,10 +39,7 @@ SideNavIcon.propTypes = {
|
|
|
39
39
|
/**
|
|
40
40
|
* Specify whether the icon should be placed in a smaller bounding box
|
|
41
41
|
*/
|
|
42
|
-
small: PropTypes.bool
|
|
43
|
-
};
|
|
44
|
-
SideNavIcon.defaultProps = {
|
|
45
|
-
small: false
|
|
42
|
+
small: PropTypes.bool
|
|
46
43
|
};
|
|
47
44
|
|
|
48
45
|
export { SideNavIcon as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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 { ReactNode } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
export interface SideNavLinkTextProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function SideNavLinkText({ className: customClassName, children, ...rest }: SideNavLinkTextProps): JSX.Element;
|
|
14
|
+
declare namespace SideNavLinkText {
|
|
15
|
+
var propTypes: {
|
|
16
|
+
/**
|
|
17
|
+
* Provide the content for the link text
|
|
18
|
+
*/
|
|
19
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
20
|
+
/**
|
|
21
|
+
* Provide an optional class to be applied to the containing node
|
|
22
|
+
*/
|
|
23
|
+
className: PropTypes.Requireable<string>;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default SideNavLinkText;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
10
|
import React__default from 'react';
|
|
12
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
13
|
|
|
14
14
|
function SideNavLinkText(_ref) {
|
|
15
15
|
let {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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 SideNavMenuProps {
|
|
9
|
+
/**
|
|
10
|
+
* An optional CSS class to apply to the component.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The content to render within the SideNavMenu component.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies whether the menu should be expanded by default.
|
|
19
|
+
*/
|
|
20
|
+
defaultExpanded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates whether the SideNavMenu is active.
|
|
23
|
+
*/
|
|
24
|
+
isActive?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies whether the SideNavMenu is in a large variation.
|
|
27
|
+
*/
|
|
28
|
+
large?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A custom icon to render next to the SideNavMenu title. This can be a function returning JSX or JSX itself.
|
|
31
|
+
*/
|
|
32
|
+
renderIcon?: React.ComponentType;
|
|
33
|
+
/**
|
|
34
|
+
* Indicates if the side navigation container is expanded or collapsed.
|
|
35
|
+
*/
|
|
36
|
+
isSideNavExpanded?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The tabIndex for the button element.
|
|
39
|
+
* If not specified, the default validation will be applied.
|
|
40
|
+
*/
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
title: string;
|
|
43
|
+
}
|
|
44
|
+
declare const SideNavMenu: React.ForwardRefExoticComponent<SideNavMenuProps & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
export default SideNavMenu;
|
|
46
|
+
export { SideNavMenu };
|
|
@@ -16,8 +16,8 @@ import { match } from '../../internal/keyboard/match.js';
|
|
|
16
16
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
17
17
|
|
|
18
18
|
var _ChevronDown;
|
|
19
|
-
const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(
|
|
20
|
-
|
|
19
|
+
const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(_ref, ref) {
|
|
20
|
+
let {
|
|
21
21
|
className: customClassName,
|
|
22
22
|
children,
|
|
23
23
|
defaultExpanded = false,
|
|
@@ -27,7 +27,7 @@ const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(
|
|
|
27
27
|
isSideNavExpanded,
|
|
28
28
|
tabIndex,
|
|
29
29
|
title
|
|
30
|
-
} =
|
|
30
|
+
} = _ref;
|
|
31
31
|
const isRail = useContext(SideNavContext);
|
|
32
32
|
const prefix = usePrefix();
|
|
33
33
|
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
|
|
@@ -111,6 +111,7 @@ SideNavMenu.propTypes = {
|
|
|
111
111
|
/**
|
|
112
112
|
* Pass in a custom icon to render next to the `SideNavMenu` title
|
|
113
113
|
*/
|
|
114
|
+
// @ts-expect-error - PropTypes are unable to cover this case.
|
|
114
115
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
115
116
|
/**
|
|
116
117
|
* Optional prop to specify the tabIndex of the button. If undefined, it will be applied default validation
|
|
@@ -121,29 +122,38 @@ SideNavMenu.propTypes = {
|
|
|
121
122
|
*/
|
|
122
123
|
title: PropTypes.string.isRequired
|
|
123
124
|
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
Defining the children parameter with the type ReactNode | ReactNode[]. This allows for various possibilities:
|
|
128
|
+
a single element, an array of elements, or null or undefined.
|
|
129
|
+
**/
|
|
124
130
|
function hasActiveChild(children) {
|
|
125
|
-
// if we have children, either a single or multiple, find if it is active
|
|
126
131
|
if (Array.isArray(children)) {
|
|
127
132
|
return children.some(child => {
|
|
128
|
-
if (!child
|
|
133
|
+
if (! /*#__PURE__*/React__default.isValidElement(child)) {
|
|
129
134
|
return false;
|
|
130
135
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
|
|
137
|
+
/** Explicitly defining the expected prop types (isActive and 'aria-current) for the children to ensure type
|
|
138
|
+
safety when accessing their props.
|
|
139
|
+
**/
|
|
140
|
+
const props = child.props;
|
|
141
|
+
if (props.isActive === true || props['aria-current']) {
|
|
135
142
|
return true;
|
|
136
143
|
}
|
|
137
144
|
return false;
|
|
138
145
|
});
|
|
139
146
|
}
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
|
|
148
|
+
// We use React.isValidElement(child) to check if the child is a valid React element before accessing its props
|
|
149
|
+
|
|
150
|
+
if ( /*#__PURE__*/React__default.isValidElement(children)) {
|
|
151
|
+
const props = children.props;
|
|
152
|
+
if (props.isActive === true || props['aria-current']) {
|
|
142
153
|
return true;
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
return false;
|
|
146
157
|
}
|
|
147
|
-
var SideNavMenu$1 = SideNavMenu;
|
|
148
158
|
|
|
149
|
-
export { SideNavMenu, SideNavMenu
|
|
159
|
+
export { SideNavMenu, SideNavMenu as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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, { ChangeEventHandler } from 'react';
|
|
8
|
+
interface SideNavSwitcherProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide an optional class to be applied to the containing node
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide the label for the switcher. This will be the first visible option
|
|
15
|
+
* when someone views this control
|
|
16
|
+
*/
|
|
17
|
+
labelText: string;
|
|
18
|
+
/**
|
|
19
|
+
* Provide a callback function that is called whenever the switcher value is
|
|
20
|
+
* updated
|
|
21
|
+
*/
|
|
22
|
+
onChange?: ChangeEventHandler<HTMLSelectElement>;
|
|
23
|
+
/**
|
|
24
|
+
* Provide an array of options to be rendered in the switcher as an
|
|
25
|
+
* `<option>`. The text value will be what is displayed to the user and is set
|
|
26
|
+
* as the `value` prop for each `<option>`.
|
|
27
|
+
*/
|
|
28
|
+
options: string[];
|
|
29
|
+
}
|
|
30
|
+
declare const SideNavSwitcher: React.ForwardRefExoticComponent<SideNavSwitcherProps & React.RefAttributes<HTMLSelectElement>>;
|
|
31
|
+
export default SideNavSwitcher;
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
import { ChevronDown } from '@carbon/icons-react';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default from 'react';
|
|
12
|
-
import { usePrefix } from '../../internal/usePrefix.js';
|
|
11
|
+
import React__default, { forwardRef } from 'react';
|
|
13
12
|
import { useId } from '../../internal/useId.js';
|
|
13
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
|
|
15
15
|
var _ChevronDown;
|
|
16
|
-
const SideNavSwitcher = /*#__PURE__*/
|
|
16
|
+
const SideNavSwitcher = /*#__PURE__*/forwardRef(function SideNavSwitcher(props, ref) {
|
|
17
17
|
const id = useId('side-nav-switcher');
|
|
18
18
|
const prefix = usePrefix();
|
|
19
19
|
const {
|
|
@@ -23,6 +23,7 @@ const SideNavSwitcher = /*#__PURE__*/React__default.forwardRef(function SideNavS
|
|
|
23
23
|
options
|
|
24
24
|
} = props;
|
|
25
25
|
const className = cx(`${prefix}--side-nav__switcher`, customClassName);
|
|
26
|
+
|
|
26
27
|
// Note for usage around `onBlur`: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md
|
|
27
28
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
28
29
|
className: className
|
|
@@ -72,8 +73,8 @@ SideNavSwitcher.propTypes = {
|
|
|
72
73
|
* `<option>`. The text value will be what is displayed to the user and is set
|
|
73
74
|
* as the `value` prop for each `<option>`.
|
|
74
75
|
*/
|
|
76
|
+
// @ts-expect-error
|
|
75
77
|
options: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
76
78
|
};
|
|
77
|
-
var SideNavSwitcher$1 = SideNavSwitcher;
|
|
78
79
|
|
|
79
|
-
export { SideNavSwitcher
|
|
80
|
+
export { SideNavSwitcher as default };
|
package/es/index.js
CHANGED
|
@@ -44,6 +44,7 @@ export { default as FluidForm } from './components/FluidForm/FluidForm.js';
|
|
|
44
44
|
export { FormContext } from './components/FluidForm/FormContext.js';
|
|
45
45
|
export { default as Form } from './components/Form/Form.js';
|
|
46
46
|
export { default as FormGroup } from './components/FormGroup/FormGroup.js';
|
|
47
|
+
export { default as FormItem } from './components/FormItem/FormItem.js';
|
|
47
48
|
export { default as FormLabel } from './components/FormLabel/FormLabel.js';
|
|
48
49
|
export { FlexGrid } from './components/Grid/FlexGrid.js';
|
|
49
50
|
export { Grid } from './components/Grid/Grid.js';
|
|
@@ -154,7 +155,6 @@ export { default as useContextMenu } from './components/ContextMenu/useContextMe
|
|
|
154
155
|
export { default as Copy } from './components/Copy/Copy.js';
|
|
155
156
|
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
156
157
|
export { default as ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary.js';
|
|
157
|
-
export { default as FormItem } from './components/FormItem/FormItem.js';
|
|
158
158
|
export { default as InlineLoading } from './components/InlineLoading/InlineLoading.js';
|
|
159
159
|
export { default as ModalWrapper } from './components/ModalWrapper/ModalWrapper.js';
|
|
160
160
|
export { default as ProgressIndicatorSkeleton } from './components/ProgressIndicator/ProgressIndicator.Skeleton.js';
|
|
@@ -195,13 +195,13 @@ class FloatingMenu extends React__default.Component {
|
|
|
195
195
|
} = prevProps;
|
|
196
196
|
const {
|
|
197
197
|
menuOffset = {},
|
|
198
|
-
menuDirection
|
|
198
|
+
menuDirection = DIRECTION_BOTTOM
|
|
199
199
|
} = _this.props;
|
|
200
200
|
if (hasChangeInOffset(oldMenuOffset, menuOffset) || oldMenuDirection !== menuDirection || isAdjustment) {
|
|
201
201
|
const {
|
|
202
202
|
flipped,
|
|
203
203
|
triggerRef,
|
|
204
|
-
updateOrientation
|
|
204
|
+
updateOrientation = null
|
|
205
205
|
} = _this.props;
|
|
206
206
|
const {
|
|
207
207
|
current: triggerEl
|
|
@@ -455,11 +455,6 @@ _defineProperty(FloatingMenu, "propTypes", {
|
|
|
455
455
|
*/
|
|
456
456
|
updateOrientation: PropTypes.func
|
|
457
457
|
});
|
|
458
|
-
_defineProperty(FloatingMenu, "defaultProps", {
|
|
459
|
-
menuOffset: {},
|
|
460
|
-
menuDirection: DIRECTION_BOTTOM,
|
|
461
|
-
updateOrientation: null
|
|
462
|
-
});
|
|
463
458
|
var FloatingMenu$1 = FloatingMenu;
|
|
464
459
|
|
|
465
460
|
export { DIRECTION_BOTTOM, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP, FloatingMenu$1 as default };
|
package/es/internal/Selection.js
CHANGED
|
@@ -189,9 +189,6 @@ _defineProperty(Selection, "propTypes", {
|
|
|
189
189
|
onChange: PropTypes.func,
|
|
190
190
|
render: PropTypes.func
|
|
191
191
|
});
|
|
192
|
-
_defineProperty(Selection, "defaultProps", {
|
|
193
|
-
initialSelectedItems: []
|
|
194
|
-
});
|
|
195
192
|
const removeAtIndex = (array, index) => {
|
|
196
193
|
const result = array.slice();
|
|
197
194
|
result.splice(index, 1);
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import React__default from 'react';
|
|
9
9
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
10
10
|
import { usePrefix } from './usePrefix.js';
|
|
11
|
+
import '../components/Text/index.js';
|
|
12
|
+
import { Text } from '../components/Text/Text.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @typedef {object} InputProps
|
|
@@ -68,13 +70,15 @@ function useNormalizedInputProps(_ref) {
|
|
|
68
70
|
};
|
|
69
71
|
if (normalizedProps.invalid) {
|
|
70
72
|
normalizedProps.icon = WarningFilled;
|
|
71
|
-
normalizedProps.validation = /*#__PURE__*/React__default.createElement(
|
|
73
|
+
normalizedProps.validation = /*#__PURE__*/React__default.createElement(Text, {
|
|
74
|
+
as: "div",
|
|
72
75
|
className: `${prefix}--form-requirement`,
|
|
73
76
|
id: normalizedProps.invalidId
|
|
74
77
|
}, invalidText);
|
|
75
78
|
} else if (normalizedProps.warn) {
|
|
76
79
|
normalizedProps.icon = WarningAltFilled;
|
|
77
|
-
normalizedProps.validation = /*#__PURE__*/React__default.createElement(
|
|
80
|
+
normalizedProps.validation = /*#__PURE__*/React__default.createElement(Text, {
|
|
81
|
+
as: "div",
|
|
78
82
|
className: `${prefix}--form-requirement`,
|
|
79
83
|
id: normalizedProps.warnId
|
|
80
84
|
}, warnText);
|
|
@@ -85,11 +85,6 @@ AccordionSkeleton.propTypes = {
|
|
|
85
85
|
*/
|
|
86
86
|
open: PropTypes__default["default"].bool
|
|
87
87
|
};
|
|
88
|
-
AccordionSkeleton.defaultProps = {
|
|
89
|
-
open: true,
|
|
90
|
-
count: 4,
|
|
91
|
-
align: 'end'
|
|
92
|
-
};
|
|
93
88
|
function AccordionSkeletonItem() {
|
|
94
89
|
const prefix = usePrefix.usePrefix();
|
|
95
90
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
@@ -16,6 +16,8 @@ var cx = require('classnames');
|
|
|
16
16
|
var Link = require('../Link/Link.js');
|
|
17
17
|
var iconsReact = require('@carbon/icons-react');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
|
+
require('../Text/index.js');
|
|
20
|
+
var Text = require('../Text/Text.js');
|
|
19
21
|
|
|
20
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
23
|
|
|
@@ -62,7 +64,7 @@ const BreadcrumbItem = /*#__PURE__*/React__default["default"].forwardRef(functio
|
|
|
62
64
|
}, rest), href ? /*#__PURE__*/React__default["default"].createElement(Link["default"], {
|
|
63
65
|
href: href,
|
|
64
66
|
"aria-current": ariaCurrent
|
|
65
|
-
}, children) : /*#__PURE__*/React__default["default"].createElement(
|
|
67
|
+
}, children) : /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
66
68
|
className: `${prefix}--link`
|
|
67
69
|
}, children));
|
|
68
70
|
}
|
|
@@ -17,6 +17,7 @@ require('../Text/index.js');
|
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
var iconsReact = require('@carbon/icons-react');
|
|
19
19
|
var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
|
|
20
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
20
21
|
var Text = require('../Text/Text.js');
|
|
21
22
|
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -32,9 +33,9 @@ const Checkbox = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
32
33
|
helperText,
|
|
33
34
|
id,
|
|
34
35
|
labelText,
|
|
35
|
-
onChange,
|
|
36
|
+
onChange = noopFn.noopFn,
|
|
36
37
|
onClick,
|
|
37
|
-
indeterminate,
|
|
38
|
+
indeterminate = false,
|
|
38
39
|
invalid,
|
|
39
40
|
invalidText,
|
|
40
41
|
hideLabel,
|
|
@@ -187,10 +188,6 @@ Checkbox.propTypes = {
|
|
|
187
188
|
*/
|
|
188
189
|
warnText: PropTypes__default["default"].node
|
|
189
190
|
};
|
|
190
|
-
Checkbox.defaultProps = {
|
|
191
|
-
onChange: () => {},
|
|
192
|
-
indeterminate: false
|
|
193
|
-
};
|
|
194
191
|
Checkbox.displayName = 'Checkbox';
|
|
195
192
|
|
|
196
193
|
exports["default"] = Checkbox;
|
|
@@ -41,21 +41,21 @@ function CodeSnippet(_ref) {
|
|
|
41
41
|
let {
|
|
42
42
|
align = 'bottom',
|
|
43
43
|
className,
|
|
44
|
-
type,
|
|
44
|
+
type = 'single',
|
|
45
45
|
children,
|
|
46
46
|
disabled,
|
|
47
47
|
feedback,
|
|
48
48
|
feedbackTimeout,
|
|
49
49
|
onClick,
|
|
50
|
-
['aria-label']: ariaLabel,
|
|
50
|
+
['aria-label']: ariaLabel = 'Copy to clipboard',
|
|
51
51
|
ariaLabel: deprecatedAriaLabel,
|
|
52
52
|
copyText,
|
|
53
53
|
copyButtonDescription,
|
|
54
54
|
light,
|
|
55
|
-
showMoreText,
|
|
56
|
-
showLessText,
|
|
55
|
+
showMoreText = 'Show more',
|
|
56
|
+
showLessText = 'Show less',
|
|
57
57
|
hideCopyButton,
|
|
58
|
-
wrapText,
|
|
58
|
+
wrapText = false,
|
|
59
59
|
maxCollapsedNumberOfRows = defaultMaxCollapsedNumberOfRows,
|
|
60
60
|
maxExpandedNumberOfRows = defaultMaxExpandedNumberOfRows,
|
|
61
61
|
minCollapsedNumberOfRows = defaultMinCollapsedNumberOfRows,
|
|
@@ -330,12 +330,5 @@ CodeSnippet.propTypes = {
|
|
|
330
330
|
*/
|
|
331
331
|
wrapText: PropTypes__default["default"].bool
|
|
332
332
|
};
|
|
333
|
-
CodeSnippet.defaultProps = {
|
|
334
|
-
['aria-label']: 'Copy to clipboard',
|
|
335
|
-
type: 'single',
|
|
336
|
-
showMoreText: 'Show more',
|
|
337
|
-
showLessText: 'Show less',
|
|
338
|
-
wrapText: false
|
|
339
|
-
};
|
|
340
333
|
|
|
341
334
|
exports["default"] = CodeSnippet;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import Downshift from 'downshift';
|
|
8
8
|
import { type ComponentProps, type ReactNode, type ComponentType, type ReactElement, type RefAttributes, type PropsWithChildren, type PropsWithoutRef, type InputHTMLAttributes, type MouseEvent } from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { ListBoxSize } from '../ListBox';
|
|
10
10
|
type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
|
|
11
11
|
interface OnChangeData<ItemType> {
|
|
12
12
|
selectedItem: ItemType | null;
|
|
@@ -139,10 +139,6 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
139
139
|
* and returns the localized string for the message
|
|
140
140
|
*/
|
|
141
141
|
translateWithId?: (id: string) => string;
|
|
142
|
-
/**
|
|
143
|
-
* Currently supports either the default type, or an inline variant
|
|
144
|
-
*/
|
|
145
|
-
type?: ListBoxType;
|
|
146
142
|
/**
|
|
147
143
|
* Specify whether the control is currently in warning state
|
|
148
144
|
*/
|
|
@@ -97,8 +97,8 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
97
97
|
['aria-label']: ariaLabel = 'Choose an item',
|
|
98
98
|
ariaLabel: deprecatedAriaLabel,
|
|
99
99
|
className: containerClassName,
|
|
100
|
-
direction,
|
|
101
|
-
disabled,
|
|
100
|
+
direction = 'bottom',
|
|
101
|
+
disabled = false,
|
|
102
102
|
downshiftProps,
|
|
103
103
|
helperText,
|
|
104
104
|
id,
|
|
@@ -106,7 +106,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
106
106
|
invalid,
|
|
107
107
|
invalidText,
|
|
108
108
|
items,
|
|
109
|
-
itemToElement,
|
|
109
|
+
itemToElement = null,
|
|
110
110
|
itemToString = defaultItemToString,
|
|
111
111
|
light,
|
|
112
112
|
onChange,
|
|
@@ -119,7 +119,6 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
119
119
|
size,
|
|
120
120
|
titleText,
|
|
121
121
|
translateWithId,
|
|
122
|
-
type: _type,
|
|
123
122
|
warn,
|
|
124
123
|
warnText,
|
|
125
124
|
...rest
|
|
@@ -324,10 +323,10 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
324
323
|
event?.persist?.();
|
|
325
324
|
}
|
|
326
325
|
}
|
|
327
|
-
if (match.match(event, keys.Home)) {
|
|
326
|
+
if (match.match(event, keys.Home) && event.code !== 'Numpad7') {
|
|
328
327
|
event.target.setSelectionRange(0, 0);
|
|
329
328
|
}
|
|
330
|
-
if (match.match(event, keys.End)) {
|
|
329
|
+
if (match.match(event, keys.End) && event.code !== 'Numpad1') {
|
|
331
330
|
event.target.setSelectionRange(event.target.value.length, event.target.value.length);
|
|
332
331
|
}
|
|
333
332
|
}
|
|
@@ -546,10 +545,6 @@ ComboBox.propTypes = {
|
|
|
546
545
|
* and returns the localized string for the message
|
|
547
546
|
*/
|
|
548
547
|
translateWithId: PropTypes__default["default"].func,
|
|
549
|
-
/**
|
|
550
|
-
* Currently supports either the default type, or an inline variant
|
|
551
|
-
*/
|
|
552
|
-
type: ListBoxPropTypes.ListBoxType,
|
|
553
548
|
/**
|
|
554
549
|
* Specify whether the control is currently in warning state
|
|
555
550
|
*/
|
|
@@ -559,14 +554,5 @@ ComboBox.propTypes = {
|
|
|
559
554
|
*/
|
|
560
555
|
warnText: PropTypes__default["default"].node
|
|
561
556
|
};
|
|
562
|
-
ComboBox.defaultProps = {
|
|
563
|
-
disabled: false,
|
|
564
|
-
itemToString: defaultItemToString,
|
|
565
|
-
itemToElement: null,
|
|
566
|
-
shouldFilterItem: defaultShouldFilterItem,
|
|
567
|
-
type: 'default',
|
|
568
|
-
['aria-label']: 'Choose an item',
|
|
569
|
-
direction: 'bottom'
|
|
570
|
-
};
|
|
571
557
|
|
|
572
558
|
exports["default"] = ComboBox;
|
|
@@ -88,7 +88,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
88
88
|
onKeyDown,
|
|
89
89
|
open,
|
|
90
90
|
preventCloseOnClickOutside,
|
|
91
|
-
selectorPrimaryFocus,
|
|
91
|
+
selectorPrimaryFocus = '[data-modal-primary-focus]',
|
|
92
92
|
selectorsFloatingMenus,
|
|
93
93
|
size,
|
|
94
94
|
launcherButtonRef,
|
|
@@ -306,9 +306,6 @@ ComposedModal.propTypes = {
|
|
|
306
306
|
*/
|
|
307
307
|
size: PropTypes__default["default"].oneOf(['xs', 'sm', 'md', 'lg'])
|
|
308
308
|
};
|
|
309
|
-
ComposedModal.defaultProps = {
|
|
310
|
-
selectorPrimaryFocus: '[data-modal-primary-focus]'
|
|
311
|
-
};
|
|
312
309
|
|
|
313
310
|
exports.ModalBody = ModalBody;
|
|
314
311
|
exports["default"] = ComposedModal;
|
|
@@ -17,6 +17,7 @@ require('../Button/Button.Skeleton.js');
|
|
|
17
17
|
var ButtonSet = require('../ButtonSet/ButtonSet.js');
|
|
18
18
|
var cx = require('classnames');
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
20
21
|
|
|
21
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
23
|
|
|
@@ -84,11 +85,11 @@ const ModalFooter = /*#__PURE__*/React__default["default"].forwardRef(function M
|
|
|
84
85
|
let {
|
|
85
86
|
children,
|
|
86
87
|
className: customClassName,
|
|
87
|
-
closeModal,
|
|
88
|
+
closeModal = noopFn.noopFn,
|
|
88
89
|
danger,
|
|
89
90
|
inputref,
|
|
90
|
-
onRequestClose,
|
|
91
|
-
onRequestSubmit,
|
|
91
|
+
onRequestClose = noopFn.noopFn,
|
|
92
|
+
onRequestSubmit = noopFn.noopFn,
|
|
92
93
|
primaryButtonDisabled,
|
|
93
94
|
primaryButtonText,
|
|
94
95
|
primaryClassName,
|
|
@@ -200,11 +201,5 @@ ModalFooter.propTypes = {
|
|
|
200
201
|
*/
|
|
201
202
|
secondaryClassName: PropTypes__default["default"].string
|
|
202
203
|
};
|
|
203
|
-
const noop = () => {};
|
|
204
|
-
ModalFooter.defaultProps = {
|
|
205
|
-
onRequestClose: noop,
|
|
206
|
-
onRequestSubmit: noop,
|
|
207
|
-
closeModal: noop
|
|
208
|
-
};
|
|
209
204
|
|
|
210
205
|
exports.ModalFooter = ModalFooter;
|
|
@@ -30,7 +30,7 @@ const ModalHeader = /*#__PURE__*/React__default["default"].forwardRef(function M
|
|
|
30
30
|
closeClassName,
|
|
31
31
|
closeIconClassName,
|
|
32
32
|
closeModal,
|
|
33
|
-
iconDescription,
|
|
33
|
+
iconDescription = 'Close',
|
|
34
34
|
label,
|
|
35
35
|
labelClassName,
|
|
36
36
|
title,
|
|
@@ -114,8 +114,5 @@ ModalHeader.propTypes = {
|
|
|
114
114
|
*/
|
|
115
115
|
titleClassName: PropTypes__default["default"].string
|
|
116
116
|
};
|
|
117
|
-
ModalHeader.defaultProps = {
|
|
118
|
-
iconDescription: 'Close'
|
|
119
|
-
};
|
|
120
117
|
|
|
121
118
|
exports.ModalHeader = ModalHeader;
|