@carbon/react 1.80.1 → 1.81.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 +781 -781
- package/es/components/Accordion/AccordionItem.d.ts +2 -2
- package/es/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/es/components/Button/Button.js +3 -0
- package/es/components/Button/ButtonBase.d.ts +2 -2
- package/es/components/ChatButton/ChatButton.js +5 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -0
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.js +1 -2
- package/es/components/ComposedModal/ModalFooter.js +0 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +5 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/FeatureFlags/index.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.d.ts +6 -1
- package/es/components/FileUploader/FileUploader.js +3 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +40 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +123 -0
- package/es/components/FluidTextInput/FluidTextInput.js +2 -2
- package/es/components/Grid/Column.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +6 -1
- package/es/components/Layer/LayerLevel.d.ts +3 -3
- package/es/components/Layer/LayerLevel.js +4 -3
- package/es/components/Layer/index.d.ts +4 -2
- package/es/components/Layer/index.js +3 -2
- package/es/components/Link/Link.js +3 -1
- package/es/components/Menu/Menu.d.ts +1 -1
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/Modal/Modal.js +5 -2
- package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/es/components/MultiSelect/MultiSelect.js +18 -3
- package/es/components/MultiSelect/index.d.ts +2 -4
- package/es/components/NumberInput/NumberInput.js +2 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +69 -17
- package/es/components/OverflowMenu/index.d.ts +3 -5
- package/es/components/OverflowMenu/index.js +9 -4
- package/es/components/OverflowMenu/next/index.js +0 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/es/components/PaginationNav/PaginationNav.js +2 -1
- package/es/components/Popover/index.d.ts +3 -2
- package/es/components/Popover/index.js +10 -5
- package/es/components/Portal/index.d.ts +1 -1
- package/es/components/Search/Search.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +3 -1
- package/es/components/Slider/Slider.d.ts +3 -13
- package/es/components/Slider/Slider.js +2 -14
- package/es/components/Tabs/Tabs.d.ts +2 -2
- package/es/components/Tabs/Tabs.js +8 -6
- package/es/components/Tabs/usePressable.js +1 -1
- package/es/components/Tag/Tag.js +9 -2
- package/es/components/Text/Text.js +3 -2
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +0 -6
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +0 -4
- package/es/components/TextInput/index.d.ts +6 -0
- package/es/components/TextInput/index.js +0 -8
- package/es/components/Tile/Tile.js +0 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +37 -41
- package/es/components/Toggletip/index.js +11 -8
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/TreeView/TreeView.d.ts +1 -1
- package/es/components/UIShell/Content.d.ts +14 -1
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +2 -99
- package/es/components/UIShell/HeaderMenu.js +10 -3
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/es/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/es/components/UIShell/HeaderMenuItem.js +3 -3
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/es/components/UIShell/Link.d.ts +8 -8
- package/es/components/UIShell/Link.js +8 -5
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/SideNavHeader.js +0 -1
- package/es/components/UIShell/SideNavLink.d.ts +3 -4
- package/es/components/UIShell/SideNavLink.js +8 -3
- package/es/components/UIShell/SideNavMenu.js +0 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +0 -1
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +7 -7
- package/es/internal/FloatingMenu.js +2 -1
- package/es/internal/clamp.d.ts +10 -0
- package/es/internal/clamp.js +13 -0
- package/es/internal/useEvent.d.ts +9 -0
- package/es/internal/useEvent.js +8 -49
- package/es/internal/useId.js +1 -1
- package/es/internal/useMatchMedia.d.ts +7 -2
- package/es/internal/useMatchMedia.js +9 -10
- package/es/internal/useNoInteractiveChildren.js +4 -2
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/isRequiredOneOf.d.ts +16 -0
- package/es/prop-types/isRequiredOneOf.js +11 -9
- package/es/tools/setupGetInstanceId.d.ts +12 -0
- package/es/tools/setupGetInstanceId.js +7 -8
- package/es/tools/toggleClass.d.ts +14 -0
- package/es/tools/toggleClass.js +9 -10
- package/es/tools/wrapComponent.d.ts +1 -1
- package/es/types/common.d.ts +1 -6
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/Button/ButtonBase.d.ts +2 -2
- package/lib/components/ChatButton/ChatButton.js +5 -3
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -0
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +2 -3
- package/lib/components/ComposedModal/ModalFooter.js +0 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +5 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/FeatureFlags/index.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.d.ts +6 -1
- package/lib/components/FileUploader/FileUploader.js +3 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +7 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +50 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +133 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/Grid/Column.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +6 -1
- package/lib/components/Layer/LayerLevel.d.ts +3 -3
- package/lib/components/Layer/LayerLevel.js +4 -2
- package/lib/components/Layer/index.d.ts +4 -2
- package/lib/components/Layer/index.js +2 -1
- package/lib/components/Link/Link.js +3 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/Modal/Modal.js +6 -3
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/lib/components/MultiSelect/MultiSelect.js +17 -2
- package/lib/components/MultiSelect/index.d.ts +2 -4
- package/lib/components/NumberInput/NumberInput.js +2 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +69 -17
- package/lib/components/OverflowMenu/index.d.ts +3 -5
- package/lib/components/OverflowMenu/index.js +8 -3
- package/lib/components/OverflowMenu/next/index.js +0 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/lib/components/PageHeader/PageHeader.js +1 -1
- package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/lib/components/PaginationNav/PaginationNav.js +2 -1
- package/lib/components/Popover/index.d.ts +3 -2
- package/lib/components/Popover/index.js +10 -5
- package/lib/components/Portal/index.d.ts +1 -1
- package/lib/components/Search/Search.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +3 -1
- package/lib/components/Slider/Slider.d.ts +3 -13
- package/lib/components/Slider/Slider.js +2 -14
- package/lib/components/Tabs/Tabs.d.ts +2 -2
- package/lib/components/Tabs/Tabs.js +7 -5
- package/lib/components/Tabs/usePressable.js +1 -1
- package/lib/components/Tag/Tag.js +9 -2
- package/lib/components/Text/Text.js +2 -1
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -6
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +0 -4
- package/lib/components/TextInput/index.d.ts +6 -0
- package/lib/components/TextInput/index.js +1 -7
- package/lib/components/Tile/Tile.js +0 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +34 -39
- package/lib/components/Toggletip/index.js +11 -8
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/TreeView/TreeView.d.ts +1 -1
- package/lib/components/UIShell/Content.d.ts +14 -1
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +2 -99
- package/lib/components/UIShell/HeaderMenu.js +10 -3
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/lib/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/lib/components/UIShell/HeaderMenuItem.js +3 -3
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/lib/components/UIShell/Link.d.ts +8 -8
- package/lib/components/UIShell/Link.js +7 -5
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/components/UIShell/SideNavHeader.js +0 -1
- package/lib/components/UIShell/SideNavLink.d.ts +3 -4
- package/lib/components/UIShell/SideNavLink.js +8 -3
- package/lib/components/UIShell/SideNavMenu.js +0 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +0 -1
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +13 -11
- package/lib/internal/FloatingMenu.js +2 -1
- package/lib/internal/clamp.d.ts +10 -0
- package/lib/internal/clamp.js +17 -0
- package/lib/internal/useEvent.d.ts +9 -0
- package/lib/internal/useEvent.js +8 -49
- package/lib/internal/useId.js +1 -1
- package/lib/internal/useMatchMedia.d.ts +7 -2
- package/lib/internal/useMatchMedia.js +9 -10
- package/lib/internal/useNoInteractiveChildren.js +4 -2
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/isRequiredOneOf.d.ts +16 -0
- package/lib/prop-types/isRequiredOneOf.js +11 -9
- package/lib/tools/setupGetInstanceId.d.ts +12 -0
- package/lib/tools/setupGetInstanceId.js +7 -8
- package/lib/tools/toggleClass.d.ts +14 -0
- package/lib/tools/toggleClass.js +9 -10
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/lib/types/common.d.ts +1 -6
- package/package.json +14 -14
- package/telemetry.yml +11 -12
- package/es/components/MultiSelect/index.js +0 -13
- package/es/internal/ClickListener.d.ts +0 -13
- package/es/internal/ClickListener.js +0 -47
- package/lib/components/MultiSelect/index.js +0 -19
- package/lib/internal/ClickListener.d.ts +0 -13
- package/lib/internal/ClickListener.js +0 -51
|
@@ -33,12 +33,12 @@ export interface AccordionItemProps {
|
|
|
33
33
|
* removed in the next major release of Carbon. Use the
|
|
34
34
|
* `renderToggle` prop instead.
|
|
35
35
|
*/
|
|
36
|
-
renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement
|
|
36
|
+
renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
|
|
37
37
|
/**
|
|
38
38
|
* The callback function to render the expand button.
|
|
39
39
|
* Can be a React component class.
|
|
40
40
|
*/
|
|
41
|
-
renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement
|
|
41
|
+
renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
|
|
42
42
|
/**
|
|
43
43
|
* The accordion title.
|
|
44
44
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { PropsWithChildren,
|
|
8
|
+
import { PropsWithChildren, HTMLElementType } from 'react';
|
|
9
9
|
export interface AspectRatioProps {
|
|
10
10
|
/**
|
|
11
11
|
* Provide a custom component or string to be rendered as
|
|
@@ -17,7 +17,7 @@ export interface AspectRatioProps {
|
|
|
17
17
|
* <AspectRatio as="article">My content</AspectRatio>
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
as?:
|
|
20
|
+
as?: HTMLElementType;
|
|
21
21
|
/**
|
|
22
22
|
* Specify a class name for the outermost node
|
|
23
23
|
* of the component.
|
|
@@ -44,6 +44,9 @@ const Button = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
44
44
|
tooltipPosition = 'top',
|
|
45
45
|
...rest
|
|
46
46
|
} = props;
|
|
47
|
+
if (ButtonImageElement && !children && !iconDescription) {
|
|
48
|
+
console.error('Button: renderIcon property specified without also providing an iconDescription property. ' + 'This may impact accessibility for screen reader users.');
|
|
49
|
+
}
|
|
47
50
|
const handleClick = evt => {
|
|
48
51
|
// Prevent clicks on the tooltip from triggering the button click event
|
|
49
52
|
if (evt.target === tooltipRef.current) {
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
import React from 'react';
|
|
7
|
+
import React, { type JSX } from 'react';
|
|
8
8
|
import { ButtonProps } from './Button';
|
|
9
|
-
declare const ButtonBase: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof
|
|
9
|
+
declare const ButtonBase: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
|
|
10
10
|
export default ButtonBase;
|
|
@@ -37,8 +37,11 @@ const ChatButton = /*#__PURE__*/React__default.forwardRef(function ChatButton(_r
|
|
|
37
37
|
kind = 'ghost';
|
|
38
38
|
size = 'sm';
|
|
39
39
|
} else {
|
|
40
|
-
//
|
|
41
|
-
size
|
|
40
|
+
// Check if size is valid and warn if not
|
|
41
|
+
if (size && !allowedSizes.includes(size)) {
|
|
42
|
+
console.error(`Invalid size "${size}" provided to ChatButton. Size must be one of: ${allowedSizes.join(', ')}. Defaulting to "lg".`);
|
|
43
|
+
size = 'lg';
|
|
44
|
+
}
|
|
42
45
|
}
|
|
43
46
|
return /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
44
47
|
disabled: disabled,
|
|
@@ -77,7 +80,6 @@ ChatButton.propTypes = {
|
|
|
77
80
|
/**
|
|
78
81
|
* A component used to render an icon.
|
|
79
82
|
*/
|
|
80
|
-
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
81
83
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
82
84
|
/**
|
|
83
85
|
* Specify the size of the `ChatButton`, from the following list of sizes:
|
|
@@ -113,6 +113,8 @@ function CodeSnippet(_ref) {
|
|
|
113
113
|
setHasRightOverflow(horizontalOverflow && codeScrollLeft + codeClientWidth !== codeScrollWidth);
|
|
114
114
|
}, [type, getCodeRefDimensions]);
|
|
115
115
|
useResizeObserver({
|
|
116
|
+
// Cast the ref until the hook supports React 19
|
|
117
|
+
// https://github.com/ZeeCoder/use-resize-observer/issues/108
|
|
116
118
|
ref: getCodeRef(),
|
|
117
119
|
onResize: () => {
|
|
118
120
|
if (codeContentRef?.current && type === 'multi') {
|
|
@@ -198,7 +198,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
198
198
|
}
|
|
199
199
|
type ComboboxComponentProps<ItemType> = PropsWithRef<PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>>;
|
|
200
200
|
export interface ComboBoxComponent {
|
|
201
|
-
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement | null;
|
|
201
|
+
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement<any> | null;
|
|
202
202
|
}
|
|
203
203
|
declare const _default: ComboBoxComponent;
|
|
204
204
|
export default _default;
|
|
@@ -56,7 +56,7 @@ export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
56
56
|
/**
|
|
57
57
|
* Provide a ref to return focus to once the modal is closed.
|
|
58
58
|
*/
|
|
59
|
-
launcherButtonRef?: RefObject<HTMLButtonElement>;
|
|
59
|
+
launcherButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
60
60
|
/**
|
|
61
61
|
* Specify an optional handler for closing modal.
|
|
62
62
|
* Returning `false` here prevents closing modal.
|
|
@@ -15,7 +15,7 @@ import { ModalFooter } from './ModalFooter.js';
|
|
|
15
15
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
16
16
|
import mergeRefs from '../../tools/mergeRefs.js';
|
|
17
17
|
import cx from 'classnames';
|
|
18
|
-
import toggleClass from '../../tools/toggleClass.js';
|
|
18
|
+
import { toggleClass } from '../../tools/toggleClass.js';
|
|
19
19
|
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
20
20
|
import wrapFocus, { wrapFocusWithoutSentinels, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
21
21
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -354,7 +354,6 @@ ComposedModal.propTypes = {
|
|
|
354
354
|
/**
|
|
355
355
|
* Provide a ref to return focus to once the modal is closed.
|
|
356
356
|
*/
|
|
357
|
-
// @ts-expect-error: Invalid derived type
|
|
358
357
|
launcherButtonRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
359
358
|
current: PropTypes.any
|
|
360
359
|
})]),
|
|
@@ -16,7 +16,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
16
16
|
/**
|
|
17
17
|
* Pass in Switch components to be rendered in the ContentSwitcher
|
|
18
18
|
*/
|
|
19
|
-
children?: ReactElement[];
|
|
19
|
+
children?: ReactElement<any>[];
|
|
20
20
|
/**
|
|
21
21
|
* Specify an optional className to be added to the container node
|
|
22
22
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
type TriggerType = Element | Document | Window | React.RefObject<Element>;
|
|
7
|
+
type TriggerType = Element | Document | Window | React.RefObject<Element | null>;
|
|
8
8
|
export interface ContextMenuProps {
|
|
9
9
|
open: boolean;
|
|
10
10
|
x: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
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.
|
|
@@ -69,8 +69,8 @@ export interface DataTableRow<ColTypes extends any[]> {
|
|
|
69
69
|
export interface DataTableHeader {
|
|
70
70
|
key: string;
|
|
71
71
|
header: React.ReactNode;
|
|
72
|
-
slug?: React.ReactElement
|
|
73
|
-
decorator?: React.ReactElement
|
|
72
|
+
slug?: React.ReactElement<any>;
|
|
73
|
+
decorator?: React.ReactElement<any>;
|
|
74
74
|
}
|
|
75
75
|
export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
76
76
|
headers: Array<DataTableHeader>;
|
|
@@ -184,7 +184,7 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
|
184
184
|
radio: boolean | undefined;
|
|
185
185
|
}
|
|
186
186
|
export interface DataTableProps<RowType, ColTypes extends any[]> extends TranslateWithId<TranslationKey> {
|
|
187
|
-
children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement
|
|
187
|
+
children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
|
|
188
188
|
experimentalAutoAlign?: boolean;
|
|
189
189
|
filterRows?: (filterRowsArgs: {
|
|
190
190
|
cellsById: Record<string, DataTableCell<ColTypes>>;
|
|
@@ -198,7 +198,7 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
|
|
|
198
198
|
locale?: string;
|
|
199
199
|
overflowMenuOnHover?: boolean;
|
|
200
200
|
radio?: boolean;
|
|
201
|
-
render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement
|
|
201
|
+
render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
|
|
202
202
|
rows: Array<Omit<DataTableRow<ColTypes>, 'cells'>>;
|
|
203
203
|
size?: DataTableSize;
|
|
204
204
|
sortRow?: (cellA: any, cellB: any, sortRowOptions: {
|
|
@@ -15,7 +15,7 @@ import { getCellId } from './tools/cells.js';
|
|
|
15
15
|
import denormalize from './tools/denormalize.js';
|
|
16
16
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
17
17
|
import { defaultFilterRows } from './tools/filter.js';
|
|
18
|
-
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
18
|
+
import { setupGetInstanceId } from '../../tools/setupGetInstanceId.js';
|
|
19
19
|
import { Table } from './Table.js';
|
|
20
20
|
import TableActionList from './TableActionList.js';
|
|
21
21
|
import TableBatchAction from './TableBatchAction.js';
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement
|
|
7
|
+
declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableActionList;
|
|
@@ -99,7 +99,7 @@ declare const TableExpandHeader: {
|
|
|
99
99
|
* Specify whether this row is expanded or not. This helps coordinate data
|
|
100
100
|
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
|
|
101
101
|
*/
|
|
102
|
-
isExpanded:
|
|
102
|
+
isExpanded: React.Validator;
|
|
103
103
|
/**
|
|
104
104
|
* Hook for when a listener initiates a request to expand the given row
|
|
105
105
|
*/
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThHTMLAttributes } from 'react';
|
|
8
8
|
export type TableHeadProps = ThHTMLAttributes<HTMLTableSectionElement>;
|
|
9
|
-
declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => React.ReactElement
|
|
9
|
+
declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => React.ReactElement<any>;
|
|
10
10
|
export default TableHead;
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement
|
|
7
|
+
declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableToolbarContent;
|
|
@@ -4,11 +4,11 @@
|
|
|
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
|
-
import { ReactElementLike
|
|
7
|
+
import { ReactElementLike } from 'prop-types';
|
|
8
8
|
import React, { ReactNode } from 'react';
|
|
9
9
|
import { ReactAttr } from '../../types/common';
|
|
10
10
|
type ExcludedAttributes = 'value' | 'onChange' | 'locale' | 'children';
|
|
11
|
-
export type ReactNodeLike = ReactElementLike |
|
|
11
|
+
export type ReactNodeLike = ReactElementLike | ReadonlyArray<ReactNode> | string | number | boolean | null | undefined;
|
|
12
12
|
export type func = (...args: any[]) => any;
|
|
13
13
|
export interface DatePickerInputProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> {
|
|
14
14
|
/**
|
|
@@ -149,7 +149,7 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
|
|
|
149
149
|
export type DropdownTranslationKey = ListBoxMenuIconTranslationKey;
|
|
150
150
|
type DropdownComponentProps<ItemType> = React.PropsWithoutRef<React.PropsWithChildren<DropdownProps<ItemType>> & React.RefAttributes<HTMLButtonElement>>;
|
|
151
151
|
export interface DropdownComponent {
|
|
152
|
-
<ItemType>(props: DropdownComponentProps<ItemType>): React.ReactElement | null;
|
|
152
|
+
<ItemType>(props: DropdownComponentProps<ItemType>): React.ReactElement<any> | null;
|
|
153
153
|
}
|
|
154
154
|
declare const _default: DropdownComponent;
|
|
155
155
|
export default _default;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import React, { ReactNode } from 'react';
|
|
8
|
+
import React, { ReactNode, type JSX } from 'react';
|
|
9
9
|
export interface FeatureFlagsProps {
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
flags?: Record<string, boolean>;
|
|
@@ -79,5 +79,10 @@ export interface FileUploaderHandle {
|
|
|
79
79
|
*/
|
|
80
80
|
clearFiles: () => void;
|
|
81
81
|
}
|
|
82
|
-
declare const FileUploader:
|
|
82
|
+
declare const FileUploader: {
|
|
83
|
+
<ItemType>(props: FileUploaderProps): React.ReactElement<any>;
|
|
84
|
+
propTypes?: any;
|
|
85
|
+
contextTypes?: any;
|
|
86
|
+
defaultProps?: any;
|
|
87
|
+
};
|
|
83
88
|
export default FileUploader;
|
|
@@ -117,7 +117,9 @@ const FileUploader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
117
117
|
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/React__default.createElement("span", _extends({
|
|
118
118
|
key: index,
|
|
119
119
|
className: selectedFileClasses,
|
|
120
|
-
ref: node =>
|
|
120
|
+
ref: node => {
|
|
121
|
+
nodes[index] = node;
|
|
122
|
+
} // eslint-disable-line
|
|
121
123
|
}, other), /*#__PURE__*/React__default.createElement(Text, {
|
|
122
124
|
as: "p",
|
|
123
125
|
className: `${prefix}--file-filename`,
|
|
@@ -69,7 +69,7 @@ export interface FileUploaderButtonProps extends Omit<ReactAttr<HTMLButtonElemen
|
|
|
69
69
|
* @deprecated The `tabIndex` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default.
|
|
70
70
|
*/
|
|
71
71
|
tabIndex?: number | string;
|
|
72
|
-
innerRef?: React.RefObject<HTMLLabelElement>;
|
|
72
|
+
innerRef?: React.RefObject<HTMLLabelElement | null>;
|
|
73
73
|
}
|
|
74
74
|
declare function FileUploaderButton({ accept, buttonKind, className, disabled, disableLabelChanges, id, labelText: ownerLabelText, multiple, onChange, name, size, innerRef, ...other }: FileUploaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
75
75
|
declare namespace FileUploaderButton {
|
|
@@ -55,7 +55,7 @@ export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButto
|
|
|
55
55
|
/**
|
|
56
56
|
* Ref to pass to the inner button element
|
|
57
57
|
*/
|
|
58
|
-
innerRef?: React.
|
|
58
|
+
innerRef?: React.Ref<HTMLButtonElement>;
|
|
59
59
|
/**
|
|
60
60
|
* @deprecated The `role` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default, and has an implicit role of button.
|
|
61
61
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
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
7
|
import React, { FunctionComponent } from 'react';
|
|
8
|
-
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
-
import { FilterableMultiSelectProps } from '../MultiSelect
|
|
8
|
+
import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
+
import { type FilterableMultiSelectProps } from '../MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
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
7
|
import React from 'react';
|
|
8
|
+
import { type MultiSelectProps } from '../MultiSelect';
|
|
8
9
|
import { UseSelectProps } from 'downshift';
|
|
9
|
-
import { MultiSelectProps } from '../MultiSelect/MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
@@ -9,11 +9,10 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import '../MultiSelect/
|
|
12
|
+
import { FilterableMultiSelect } from '../MultiSelect/FilterableMultiSelect.js';
|
|
13
|
+
import { MultiSelect } from '../MultiSelect/MultiSelect.js';
|
|
13
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
|
-
import FilterableMultiSelect from '../MultiSelect/FilterableMultiSelect.js';
|
|
16
|
-
import MultiSelect from '../MultiSelect/MultiSelect.js';
|
|
17
16
|
|
|
18
17
|
const FluidMultiSelect = /*#__PURE__*/React__default.forwardRef(function FluidMultiSelect(_ref, ref) {
|
|
19
18
|
let {
|
|
@@ -36,7 +35,10 @@ const FluidMultiSelect = /*#__PURE__*/React__default.forwardRef(function FluidMu
|
|
|
36
35
|
React__default.createElement(FilterableMultiSelect, _extends({
|
|
37
36
|
ref: ref,
|
|
38
37
|
className: classNames
|
|
39
|
-
}, other)) :
|
|
38
|
+
}, other)) :
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
React__default.createElement(MultiSelect, _extends({
|
|
40
42
|
ref: ref,
|
|
41
43
|
className: classNames
|
|
42
44
|
}, other)));
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
14
|
+
|
|
15
|
+
const FluidNumberInputSkeleton = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
...other
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
22
|
+
value: {
|
|
23
|
+
isFluid: true
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
26
|
+
className: cx(`${prefix}--form-item ${prefix}--text-input--fluid__skeleton`, className)
|
|
27
|
+
}, other), /*#__PURE__*/React__default.createElement("span", {
|
|
28
|
+
className: `${prefix}--label ${prefix}--skeleton`
|
|
29
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
30
|
+
className: `${prefix}--skeleton ${prefix}--text-input`
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
33
|
+
FluidNumberInputSkeleton.propTypes = {
|
|
34
|
+
/**
|
|
35
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
36
|
+
*/
|
|
37
|
+
className: PropTypes.string
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { FluidNumberInputSkeleton as default };
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import '../NumberInput/NumberInput.Skeleton.js';
|
|
13
|
+
import { NumberInput } from '../NumberInput/NumberInput.js';
|
|
14
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
|
+
|
|
17
|
+
const FluidNumberInput = /*#__PURE__*/React__default.forwardRef(function FluidNumberInput(_ref, ref) {
|
|
18
|
+
let {
|
|
19
|
+
className,
|
|
20
|
+
...other
|
|
21
|
+
} = _ref;
|
|
22
|
+
const prefix = usePrefix();
|
|
23
|
+
const classNames = cx(`${prefix}--number-input--fluid`, className);
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
25
|
+
value: {
|
|
26
|
+
isFluid: true
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React__default.createElement(NumberInput, _extends({
|
|
29
|
+
ref: ref,
|
|
30
|
+
className: classNames
|
|
31
|
+
}, other)));
|
|
32
|
+
});
|
|
33
|
+
FluidNumberInput.propTypes = {
|
|
34
|
+
/**
|
|
35
|
+
* `true` to allow empty string.
|
|
36
|
+
*/
|
|
37
|
+
allowEmpty: PropTypes.bool,
|
|
38
|
+
/**
|
|
39
|
+
* Specify an optional className to be applied to the wrapper node
|
|
40
|
+
*/
|
|
41
|
+
className: PropTypes.string,
|
|
42
|
+
/**
|
|
43
|
+
* Optional starting value for uncontrolled state
|
|
44
|
+
*/
|
|
45
|
+
defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
46
|
+
/**
|
|
47
|
+
* Specify if the wheel functionality for the input should be disabled, or not
|
|
48
|
+
*/
|
|
49
|
+
disableWheel: PropTypes.bool,
|
|
50
|
+
/**
|
|
51
|
+
* Specify if the control should be disabled, or not
|
|
52
|
+
*/
|
|
53
|
+
disabled: PropTypes.bool,
|
|
54
|
+
/**
|
|
55
|
+
* Provide a description for up/down icons that can be read by screen readers
|
|
56
|
+
*/
|
|
57
|
+
iconDescription: PropTypes.string,
|
|
58
|
+
/**
|
|
59
|
+
* Specify a custom `id` for the input
|
|
60
|
+
*/
|
|
61
|
+
id: PropTypes.string.isRequired,
|
|
62
|
+
/**
|
|
63
|
+
* Specify if the currently value is invalid.
|
|
64
|
+
*/
|
|
65
|
+
invalid: PropTypes.bool,
|
|
66
|
+
/**
|
|
67
|
+
* Message which is displayed if the value is invalid.
|
|
68
|
+
*/
|
|
69
|
+
invalidText: PropTypes.node,
|
|
70
|
+
/**
|
|
71
|
+
* Generic `label` that will be used as the textual representation of what
|
|
72
|
+
* this field is for
|
|
73
|
+
*/
|
|
74
|
+
label: PropTypes.node,
|
|
75
|
+
/**
|
|
76
|
+
* The maximum value.
|
|
77
|
+
*/
|
|
78
|
+
max: PropTypes.number,
|
|
79
|
+
/**
|
|
80
|
+
* The minimum value.
|
|
81
|
+
*/
|
|
82
|
+
min: PropTypes.number,
|
|
83
|
+
/**
|
|
84
|
+
* Provide an optional handler that is called when the internal state of
|
|
85
|
+
* NumberInput changes. This handler is called with event and state info.
|
|
86
|
+
* `(event, { value, direction }) => void`
|
|
87
|
+
*/
|
|
88
|
+
onChange: PropTypes.func,
|
|
89
|
+
/**
|
|
90
|
+
* Provide an optional function to be called when the up/down button is clicked
|
|
91
|
+
*/
|
|
92
|
+
onClick: PropTypes.func,
|
|
93
|
+
/**
|
|
94
|
+
* Provide an optional function to be called when a key is pressed in the number input
|
|
95
|
+
*/
|
|
96
|
+
onKeyUp: PropTypes.func,
|
|
97
|
+
/**
|
|
98
|
+
* Specify how much the values should increase/decrease upon clicking on up/down button
|
|
99
|
+
*/
|
|
100
|
+
step: PropTypes.number,
|
|
101
|
+
/**
|
|
102
|
+
* Provide custom text for the component for each translation id
|
|
103
|
+
*/
|
|
104
|
+
translateWithId: PropTypes.func,
|
|
105
|
+
/**
|
|
106
|
+
* Specify the value of the input
|
|
107
|
+
*/
|
|
108
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
109
|
+
/**
|
|
110
|
+
* Specify whether the control is currently in warning state
|
|
111
|
+
*/
|
|
112
|
+
warn: PropTypes.bool,
|
|
113
|
+
/**
|
|
114
|
+
* Provide the text that is displayed when the control is in warning state
|
|
115
|
+
*/
|
|
116
|
+
warnText: PropTypes.node,
|
|
117
|
+
/**
|
|
118
|
+
* Whether or not the component is readonly
|
|
119
|
+
*/
|
|
120
|
+
readOnly: PropTypes.bool
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { FluidNumberInput as default };
|
|
@@ -9,12 +9,12 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import '../TextInput/
|
|
12
|
+
import TextInput from '../TextInput/TextInput.js';
|
|
13
|
+
import '../TextInput/TextInput.Skeleton.js';
|
|
13
14
|
import '../TextInput/ControlledPasswordInput.js';
|
|
14
15
|
import PasswordInput from '../TextInput/PasswordInput.js';
|
|
15
16
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
17
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
17
|
-
import TextInput from '../TextInput/TextInput.js';
|
|
18
18
|
|
|
19
19
|
const FluidTextInput = /*#__PURE__*/React__default.forwardRef(function FluidTextInput(_ref, ref) {
|
|
20
20
|
let {
|
|
@@ -13,7 +13,7 @@ import React__default from 'react';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { useGridSettings } from './GridContext.js';
|
|
15
15
|
|
|
16
|
-
const Column = /*#__PURE__*/React__default.forwardRef(
|
|
16
|
+
const Column = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
17
|
let {
|
|
18
18
|
as,
|
|
19
19
|
children,
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
export interface GridBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* Specify grid alignment. Default is center
|
|
12
|
+
*/
|
|
13
|
+
align?: 'start' | 'center' | 'end';
|
|
9
14
|
/**
|
|
10
15
|
* Pass in content that will be rendered within the `Grid`
|
|
11
16
|
*/
|
|
@@ -33,5 +38,5 @@ export type GridProps<T extends React.ElementType> = PolymorphicComponentPropWit
|
|
|
33
38
|
export interface GridComponent {
|
|
34
39
|
<T extends React.ElementType = 'div'>(props: GridProps<T>): React.ReactElement | null;
|
|
35
40
|
displayName?: string;
|
|
36
|
-
propTypes?:
|
|
41
|
+
propTypes?: PropTypes.WeakValidationMap<GridProps<any>>;
|
|
37
42
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
2
|
+
* Copyright IBM Corp. 2023, 2025
|
|
3
3
|
*
|
|
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
7
|
export declare const levels: readonly ["one", "two", "three"];
|
|
8
|
-
export declare const MIN_LEVEL = 0;
|
|
9
|
-
export declare const MAX_LEVEL: number;
|
|
10
8
|
export declare const LayerLevels: readonly [0, 1, 2];
|
|
9
|
+
export declare const MIN_LEVEL: 0;
|
|
10
|
+
export declare const MAX_LEVEL: 0 | 1 | 2;
|
|
11
11
|
export type LayerLevel = (typeof LayerLevels)[number];
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const levels = ['one', 'two', 'three'];
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const LayerLevels = [0, 1, 2];
|
|
10
|
+
const MIN_LEVEL = LayerLevels[0];
|
|
11
|
+
const MAX_LEVEL = LayerLevels[LayerLevels.length - 1];
|
|
11
12
|
|
|
12
|
-
export { MAX_LEVEL, MIN_LEVEL, levels };
|
|
13
|
+
export { LayerLevels, MAX_LEVEL, MIN_LEVEL, levels };
|