@carbon/react 1.80.0 → 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 +869 -869
- 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 +17 -10
- 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 +22 -7
- 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 +16 -9
- 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 +21 -6
- 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
|
@@ -47,8 +47,11 @@ const ChatButton = /*#__PURE__*/React__default["default"].forwardRef(function Ch
|
|
|
47
47
|
kind = 'ghost';
|
|
48
48
|
size = 'sm';
|
|
49
49
|
} else {
|
|
50
|
-
//
|
|
51
|
-
size
|
|
50
|
+
// Check if size is valid and warn if not
|
|
51
|
+
if (size && !allowedSizes.includes(size)) {
|
|
52
|
+
console.error(`Invalid size "${size}" provided to ChatButton. Size must be one of: ${allowedSizes.join(', ')}. Defaulting to "lg".`);
|
|
53
|
+
size = 'lg';
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
return /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
|
|
54
57
|
disabled: disabled,
|
|
@@ -87,7 +90,6 @@ ChatButton.propTypes = {
|
|
|
87
90
|
/**
|
|
88
91
|
* A component used to render an icon.
|
|
89
92
|
*/
|
|
90
|
-
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
91
93
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
92
94
|
/**
|
|
93
95
|
* Specify the size of the `ChatButton`, from the following list of sizes:
|
|
@@ -125,6 +125,8 @@ function CodeSnippet(_ref) {
|
|
|
125
125
|
setHasRightOverflow(horizontalOverflow && codeScrollLeft + codeClientWidth !== codeScrollWidth);
|
|
126
126
|
}, [type, getCodeRefDimensions]);
|
|
127
127
|
useResizeObserver__default["default"]({
|
|
128
|
+
// Cast the ref until the hook supports React 19
|
|
129
|
+
// https://github.com/ZeeCoder/use-resize-observer/issues/108
|
|
128
130
|
ref: getCodeRef(),
|
|
129
131
|
onResize: () => {
|
|
130
132
|
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.
|
|
@@ -29,6 +29,7 @@ var index$1 = require('../FeatureFlags/index.js');
|
|
|
29
29
|
var events = require('../../tools/events.js');
|
|
30
30
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
31
31
|
var index$2 = require('../Dialog/index.js');
|
|
32
|
+
var warning = require('../../internal/warning.js');
|
|
32
33
|
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
|
|
33
34
|
|
|
34
35
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -131,9 +132,9 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
131
132
|
const startSentinel = React.useRef(null);
|
|
132
133
|
const endSentinel = React.useRef(null);
|
|
133
134
|
const onMouseDownTarget = React.useRef(null);
|
|
134
|
-
const enableDialogElement =
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
const enableDialogElement = index$1.useFeatureFlag('enable-dialog-element');
|
|
136
|
+
const focusTrapWithoutSentinels = index$1.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
|
|
137
|
+
process.env.NODE_ENV !== "production" ? warning.warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
|
|
137
138
|
|
|
138
139
|
// Keep track of modal open/close state
|
|
139
140
|
// and propagate it to the document.body
|
|
@@ -141,14 +142,14 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
141
142
|
if (!enableDialogElement && open !== wasOpen) {
|
|
142
143
|
setIsOpen(!!open);
|
|
143
144
|
setWasOpen(!!open);
|
|
144
|
-
toggleClass
|
|
145
|
+
toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, !!open);
|
|
145
146
|
}
|
|
146
147
|
}, [open, wasOpen, prefix]);
|
|
147
148
|
// Remove the document.body className on unmount
|
|
148
149
|
React.useEffect(() => {
|
|
149
150
|
if (!enableDialogElement) {
|
|
150
151
|
return () => {
|
|
151
|
-
toggleClass
|
|
152
|
+
toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, false);
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
155
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
@@ -159,6 +160,13 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
159
160
|
if (match.match(event, keys.Escape)) {
|
|
160
161
|
closeModal(event);
|
|
161
162
|
}
|
|
163
|
+
if (focusTrapWithoutSentinels && open && match.match(event, keys.Tab) && innerModal.current) {
|
|
164
|
+
wrapFocus.wrapFocusWithoutSentinels({
|
|
165
|
+
containerNode: innerModal.current,
|
|
166
|
+
currentActiveNode: event.target,
|
|
167
|
+
event: event
|
|
168
|
+
});
|
|
169
|
+
}
|
|
162
170
|
}
|
|
163
171
|
onKeyDown?.(event);
|
|
164
172
|
}
|
|
@@ -293,7 +301,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
293
301
|
"aria-modal": "true",
|
|
294
302
|
"aria-label": ariaLabel ? ariaLabel : generatedAriaLabel,
|
|
295
303
|
"aria-labelledby": ariaLabelledBy
|
|
296
|
-
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
304
|
+
}, !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
297
305
|
type: "button",
|
|
298
306
|
ref: startSentinel,
|
|
299
307
|
className: `${prefix}--visually-hidden`
|
|
@@ -302,7 +310,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
302
310
|
className: `${prefix}--modal-container-body`
|
|
303
311
|
}, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
304
312
|
className: `${prefix}--modal--inner__decorator`
|
|
305
|
-
}, normalizedDecorator) : '', childrenWithProps), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
313
|
+
}, normalizedDecorator) : '', childrenWithProps), !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
306
314
|
type: "button",
|
|
307
315
|
ref: endSentinel,
|
|
308
316
|
className: `${prefix}--visually-hidden`
|
|
@@ -312,7 +320,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
312
320
|
role: "presentation",
|
|
313
321
|
ref: ref,
|
|
314
322
|
"aria-hidden": !open,
|
|
315
|
-
onBlur: !enableDialogElement ? handleBlur : () => {},
|
|
323
|
+
onBlur: !enableDialogElement && !focusTrapWithoutSentinels ? handleBlur : () => {},
|
|
316
324
|
onClick: events.composeEventHandlers([rest?.onClick, handleOnClick]),
|
|
317
325
|
onMouseDown: events.composeEventHandlers([rest?.onMouseDown, handleOnMouseDown]),
|
|
318
326
|
onKeyDown: handleKeyDown,
|
|
@@ -356,7 +364,6 @@ ComposedModal.propTypes = {
|
|
|
356
364
|
/**
|
|
357
365
|
* Provide a ref to return focus to once the modal is closed.
|
|
358
366
|
*/
|
|
359
|
-
// @ts-expect-error: Invalid derived type
|
|
360
367
|
launcherButtonRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
361
368
|
current: PropTypes__default["default"].any
|
|
362
369
|
})]),
|
|
@@ -159,7 +159,6 @@ ModalFooter.propTypes = {
|
|
|
159
159
|
/**
|
|
160
160
|
* The `ref` callback for the primary button.
|
|
161
161
|
*/
|
|
162
|
-
// @ts-expect-error: Invalid derived type
|
|
163
162
|
inputref: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
164
163
|
current: PropTypes__default["default"].any
|
|
165
164
|
})]),
|
|
@@ -83,7 +83,6 @@ ContainedListItem.propTypes = {
|
|
|
83
83
|
/**
|
|
84
84
|
* A component used to render an icon.
|
|
85
85
|
*/
|
|
86
|
-
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
87
86
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])
|
|
88
87
|
};
|
|
89
88
|
|
|
@@ -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: {
|
|
@@ -49,7 +49,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
49
49
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
50
50
|
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
51
51
|
|
|
52
|
-
const getInstanceId = setupGetInstanceId
|
|
52
|
+
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
53
53
|
const translationKeys = {
|
|
54
54
|
expandRow: 'carbon.table.row.expand',
|
|
55
55
|
collapseRow: 'carbon.table.row.collapse',
|
|
@@ -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;
|
|
@@ -127,7 +127,9 @@ const FileUploader = /*#__PURE__*/React__default["default"].forwardRef((_ref, re
|
|
|
127
127
|
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({
|
|
128
128
|
key: index,
|
|
129
129
|
className: selectedFileClasses,
|
|
130
|
-
ref: node =>
|
|
130
|
+
ref: node => {
|
|
131
|
+
nodes[index] = node;
|
|
132
|
+
} // eslint-disable-line
|
|
131
133
|
}, other), /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
132
134
|
as: "p",
|
|
133
135
|
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
|
}
|
|
@@ -13,11 +13,10 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
-
require('../MultiSelect/index.js');
|
|
17
|
-
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
|
-
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
16
|
var FilterableMultiSelect = require('../MultiSelect/FilterableMultiSelect.js');
|
|
20
17
|
var MultiSelect = require('../MultiSelect/MultiSelect.js');
|
|
18
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
21
20
|
|
|
22
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
22
|
|
|
@@ -43,10 +42,13 @@ const FluidMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
|
43
42
|
}, isFilterable ?
|
|
44
43
|
/*#__PURE__*/
|
|
45
44
|
// @ts-ignore
|
|
46
|
-
React__default["default"].createElement(FilterableMultiSelect
|
|
45
|
+
React__default["default"].createElement(FilterableMultiSelect.FilterableMultiSelect, _rollupPluginBabelHelpers["extends"]({
|
|
47
46
|
ref: ref,
|
|
48
47
|
className: classNames
|
|
49
|
-
}, other)) :
|
|
48
|
+
}, other)) :
|
|
49
|
+
/*#__PURE__*/
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
React__default["default"].createElement(MultiSelect.MultiSelect, _rollupPluginBabelHelpers["extends"]({
|
|
50
52
|
ref: ref,
|
|
51
53
|
className: classNames
|
|
52
54
|
}, other)));
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
const FluidNumberInputSkeleton = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
className,
|
|
28
|
+
...other
|
|
29
|
+
} = _ref;
|
|
30
|
+
const prefix = usePrefix.usePrefix();
|
|
31
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
32
|
+
value: {
|
|
33
|
+
isFluid: true
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
36
|
+
className: cx__default["default"](`${prefix}--form-item ${prefix}--text-input--fluid__skeleton`, className)
|
|
37
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
38
|
+
className: `${prefix}--label ${prefix}--skeleton`
|
|
39
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
40
|
+
className: `${prefix}--skeleton ${prefix}--text-input`
|
|
41
|
+
})));
|
|
42
|
+
};
|
|
43
|
+
FluidNumberInputSkeleton.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
46
|
+
*/
|
|
47
|
+
className: PropTypes__default["default"].string
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports["default"] = FluidNumberInputSkeleton;
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
require('../NumberInput/NumberInput.Skeleton.js');
|
|
17
|
+
var NumberInput = require('../NumberInput/NumberInput.js');
|
|
18
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
+
|
|
27
|
+
const FluidNumberInput = /*#__PURE__*/React__default["default"].forwardRef(function FluidNumberInput(_ref, ref) {
|
|
28
|
+
let {
|
|
29
|
+
className,
|
|
30
|
+
...other
|
|
31
|
+
} = _ref;
|
|
32
|
+
const prefix = usePrefix.usePrefix();
|
|
33
|
+
const classNames = cx__default["default"](`${prefix}--number-input--fluid`, className);
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
isFluid: true
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement(NumberInput.NumberInput, _rollupPluginBabelHelpers["extends"]({
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: classNames
|
|
41
|
+
}, other)));
|
|
42
|
+
});
|
|
43
|
+
FluidNumberInput.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* `true` to allow empty string.
|
|
46
|
+
*/
|
|
47
|
+
allowEmpty: PropTypes__default["default"].bool,
|
|
48
|
+
/**
|
|
49
|
+
* Specify an optional className to be applied to the wrapper node
|
|
50
|
+
*/
|
|
51
|
+
className: PropTypes__default["default"].string,
|
|
52
|
+
/**
|
|
53
|
+
* Optional starting value for uncontrolled state
|
|
54
|
+
*/
|
|
55
|
+
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
56
|
+
/**
|
|
57
|
+
* Specify if the wheel functionality for the input should be disabled, or not
|
|
58
|
+
*/
|
|
59
|
+
disableWheel: PropTypes__default["default"].bool,
|
|
60
|
+
/**
|
|
61
|
+
* Specify if the control should be disabled, or not
|
|
62
|
+
*/
|
|
63
|
+
disabled: PropTypes__default["default"].bool,
|
|
64
|
+
/**
|
|
65
|
+
* Provide a description for up/down icons that can be read by screen readers
|
|
66
|
+
*/
|
|
67
|
+
iconDescription: PropTypes__default["default"].string,
|
|
68
|
+
/**
|
|
69
|
+
* Specify a custom `id` for the input
|
|
70
|
+
*/
|
|
71
|
+
id: PropTypes__default["default"].string.isRequired,
|
|
72
|
+
/**
|
|
73
|
+
* Specify if the currently value is invalid.
|
|
74
|
+
*/
|
|
75
|
+
invalid: PropTypes__default["default"].bool,
|
|
76
|
+
/**
|
|
77
|
+
* Message which is displayed if the value is invalid.
|
|
78
|
+
*/
|
|
79
|
+
invalidText: PropTypes__default["default"].node,
|
|
80
|
+
/**
|
|
81
|
+
* Generic `label` that will be used as the textual representation of what
|
|
82
|
+
* this field is for
|
|
83
|
+
*/
|
|
84
|
+
label: PropTypes__default["default"].node,
|
|
85
|
+
/**
|
|
86
|
+
* The maximum value.
|
|
87
|
+
*/
|
|
88
|
+
max: PropTypes__default["default"].number,
|
|
89
|
+
/**
|
|
90
|
+
* The minimum value.
|
|
91
|
+
*/
|
|
92
|
+
min: PropTypes__default["default"].number,
|
|
93
|
+
/**
|
|
94
|
+
* Provide an optional handler that is called when the internal state of
|
|
95
|
+
* NumberInput changes. This handler is called with event and state info.
|
|
96
|
+
* `(event, { value, direction }) => void`
|
|
97
|
+
*/
|
|
98
|
+
onChange: PropTypes__default["default"].func,
|
|
99
|
+
/**
|
|
100
|
+
* Provide an optional function to be called when the up/down button is clicked
|
|
101
|
+
*/
|
|
102
|
+
onClick: PropTypes__default["default"].func,
|
|
103
|
+
/**
|
|
104
|
+
* Provide an optional function to be called when a key is pressed in the number input
|
|
105
|
+
*/
|
|
106
|
+
onKeyUp: PropTypes__default["default"].func,
|
|
107
|
+
/**
|
|
108
|
+
* Specify how much the values should increase/decrease upon clicking on up/down button
|
|
109
|
+
*/
|
|
110
|
+
step: PropTypes__default["default"].number,
|
|
111
|
+
/**
|
|
112
|
+
* Provide custom text for the component for each translation id
|
|
113
|
+
*/
|
|
114
|
+
translateWithId: PropTypes__default["default"].func,
|
|
115
|
+
/**
|
|
116
|
+
* Specify the value of the input
|
|
117
|
+
*/
|
|
118
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
119
|
+
/**
|
|
120
|
+
* Specify whether the control is currently in warning state
|
|
121
|
+
*/
|
|
122
|
+
warn: PropTypes__default["default"].bool,
|
|
123
|
+
/**
|
|
124
|
+
* Provide the text that is displayed when the control is in warning state
|
|
125
|
+
*/
|
|
126
|
+
warnText: PropTypes__default["default"].node,
|
|
127
|
+
/**
|
|
128
|
+
* Whether or not the component is readonly
|
|
129
|
+
*/
|
|
130
|
+
readOnly: PropTypes__default["default"].bool
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
exports["default"] = FluidNumberInput;
|
|
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
-
require('../TextInput/
|
|
16
|
+
var TextInput = require('../TextInput/TextInput.js');
|
|
17
|
+
require('../TextInput/TextInput.Skeleton.js');
|
|
17
18
|
require('../TextInput/ControlledPasswordInput.js');
|
|
18
19
|
var PasswordInput = require('../TextInput/PasswordInput.js');
|
|
19
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
21
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
21
|
-
var TextInput = require('../TextInput/TextInput.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -42,7 +42,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
42
42
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
43
43
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
44
44
|
|
|
45
|
-
const Column = /*#__PURE__*/React__default["default"].forwardRef(
|
|
45
|
+
const Column = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
46
46
|
let {
|
|
47
47
|
as,
|
|
48
48
|
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
|
}
|