@carbon/react 1.76.0 → 1.77.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 +794 -759
- package/es/components/Button/Button.d.ts +9 -1
- package/es/components/Button/Button.js +8 -0
- package/es/components/CodeSnippet/CodeSnippet.d.ts +2 -2
- package/es/components/ComboBox/ComboBox.d.ts +2 -2
- package/es/components/ComboBox/ComboBox.js +34 -12
- package/es/components/ComboButton/index.js +1 -2
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/ContentSwitcher/index.d.ts +0 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +0 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/DataTable/DataTable.d.ts +12 -20
- package/es/components/DataTable/DataTable.js +1 -9
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableBody.js +1 -1
- package/es/components/DataTable/TableContext.d.ts +0 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.js +1 -2
- package/es/components/FluidForm/FormContext.d.ts +0 -1
- package/es/components/Grid/CSSGrid.js +1 -1
- package/es/components/Grid/Grid.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +0 -1
- package/es/components/Heading/index.d.ts +1 -1
- package/es/components/IconButton/index.d.ts +17 -1
- package/es/components/IconButton/index.js +20 -1
- package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/es/components/InlineLoading/InlineLoading.js +21 -7
- package/es/components/Menu/Menu.js +2 -2
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/MenuButton/index.d.ts +1 -1
- package/es/components/MenuButton/index.js +1 -2
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/Modal/next/index.d.ts +175 -0
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +1 -2
- package/es/components/Popover/index.js +2 -3
- package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/es/components/RadioTile/RadioTile.d.ts +1 -1
- package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Slider/index.d.ts +0 -1
- package/es/components/Tabs/Tabs.d.ts +3 -3
- package/es/components/Tabs/Tabs.js +4 -4
- package/es/components/Tag/DismissibleTag.d.ts +2 -2
- package/es/components/Tag/OperationalTag.d.ts +1 -1
- package/es/components/Tag/SelectableTag.d.ts +2 -2
- package/es/components/Text/index.d.ts +2 -2
- package/es/components/TextInput/PasswordInput.d.ts +1 -1
- package/es/components/Theme/index.d.ts +1 -1
- package/es/components/Tile/Tile.d.ts +1 -1
- package/es/components/Tile/Tile.js +1 -1
- package/es/components/Toggletip/index.d.ts +3 -3
- package/es/components/Toggletip/index.js +5 -4
- package/es/components/Tooltip/Tooltip.d.ts +17 -1
- package/es/components/Tooltip/Tooltip.js +12 -2
- package/es/components/TreeView/TreeNode.d.ts +27 -19
- package/es/components/TreeView/TreeNode.js +100 -31
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/components/UIShell/Content.d.ts +9 -9
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +69 -25
- package/es/components/UIShell/HeaderMenuButton.d.ts +69 -27
- package/es/components/UIShell/HeaderMenuItem.d.ts +4 -3
- package/es/components/UIShell/HeaderMenuItem.js +1 -1
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +69 -25
- package/es/components/UIShell/Link.d.ts +14 -11
- package/es/components/UIShell/Link.js +5 -6
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/SideNavLink.js +1 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +51 -3
- package/es/components/UIShell/SideNavMenuItem.js +6 -6
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/internal/PolymorphicProps.d.ts +0 -1
- package/es/internal/Selection.d.ts +38 -0
- package/es/internal/Selection.js +26 -113
- package/es/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +55 -0
- package/es/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +23 -0
- package/es/node_modules/es-toolkit/dist/function/debounce.mjs.js +70 -0
- package/es/tools/wrapComponent.d.ts +1 -1
- package/lib/components/Button/Button.d.ts +9 -1
- package/lib/components/Button/Button.js +8 -0
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +2 -2
- package/lib/components/ComboBox/ComboBox.d.ts +2 -2
- package/lib/components/ComboBox/ComboBox.js +34 -12
- package/lib/components/ComboButton/index.js +1 -2
- package/lib/components/ComposedModal/ComposedModal.js +2 -2
- package/lib/components/ContentSwitcher/index.d.ts +0 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +0 -1
- package/lib/components/Copy/Copy.js +2 -2
- package/lib/components/DataTable/DataTable.d.ts +12 -20
- package/lib/components/DataTable/DataTable.js +1 -9
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableBody.js +1 -1
- package/lib/components/DataTable/TableContext.d.ts +0 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -2
- package/lib/components/FluidForm/FormContext.d.ts +0 -1
- package/lib/components/Grid/CSSGrid.js +1 -1
- package/lib/components/Grid/Grid.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +0 -1
- package/lib/components/Heading/index.d.ts +1 -1
- package/lib/components/IconButton/index.d.ts +17 -1
- package/lib/components/IconButton/index.js +20 -1
- package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/lib/components/InlineLoading/InlineLoading.js +20 -6
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/MenuButton/index.d.ts +1 -1
- package/lib/components/MenuButton/index.js +1 -2
- package/lib/components/Modal/Modal.js +2 -2
- package/lib/components/Modal/next/index.d.ts +175 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +1 -2
- package/lib/components/Popover/index.js +2 -3
- package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/lib/components/RadioTile/RadioTile.d.ts +1 -1
- package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.js +2 -2
- package/lib/components/Slider/index.d.ts +0 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -3
- package/lib/components/Tabs/Tabs.js +6 -6
- package/lib/components/Tag/DismissibleTag.d.ts +2 -2
- package/lib/components/Tag/OperationalTag.d.ts +1 -1
- package/lib/components/Tag/SelectableTag.d.ts +2 -2
- package/lib/components/Text/index.d.ts +2 -2
- package/lib/components/TextInput/PasswordInput.d.ts +1 -1
- package/lib/components/Theme/index.d.ts +1 -1
- package/lib/components/Tile/Tile.d.ts +1 -1
- package/lib/components/Tile/Tile.js +1 -1
- package/lib/components/Toggletip/index.d.ts +3 -3
- package/lib/components/Toggletip/index.js +5 -4
- package/lib/components/Tooltip/Tooltip.d.ts +17 -1
- package/lib/components/Tooltip/Tooltip.js +12 -2
- package/lib/components/TreeView/TreeNode.d.ts +27 -19
- package/lib/components/TreeView/TreeNode.js +100 -31
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/components/UIShell/Content.d.ts +9 -9
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +69 -25
- package/lib/components/UIShell/HeaderMenuButton.d.ts +69 -27
- package/lib/components/UIShell/HeaderMenuItem.d.ts +4 -3
- package/lib/components/UIShell/HeaderMenuItem.js +1 -1
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +69 -25
- package/lib/components/UIShell/Link.d.ts +14 -11
- package/lib/components/UIShell/Link.js +4 -4
- package/lib/components/UIShell/SideNav.js +3 -3
- package/lib/components/UIShell/SideNavLink.js +1 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +51 -3
- package/lib/components/UIShell/SideNavMenuItem.js +6 -6
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/internal/PolymorphicProps.d.ts +0 -1
- package/lib/internal/Selection.d.ts +38 -0
- package/lib/internal/Selection.js +24 -114
- package/lib/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +59 -0
- package/lib/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +27 -0
- package/lib/node_modules/es-toolkit/dist/function/debounce.mjs.js +74 -0
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/package.json +10 -9
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -896
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -76
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -139
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -909
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -80
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -163
|
@@ -0,0 +1,175 @@
|
|
|
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, { ReactNode } from 'react';
|
|
8
|
+
import { ReactAttr } from '../../../types/common';
|
|
9
|
+
import { InlineLoadingStatus } from '../../InlineLoading/InlineLoading';
|
|
10
|
+
export declare const ModalSizes: readonly ["xs", "sm", "md", "lg"];
|
|
11
|
+
export type ModalSize = (typeof ModalSizes)[number];
|
|
12
|
+
export interface ModalSecondaryButton {
|
|
13
|
+
buttonText?: string | ReactNode;
|
|
14
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface BaseModalProps extends ReactAttr<HTMLDivElement> {
|
|
17
|
+
/**
|
|
18
|
+
* Required props for the accessibility label of the header
|
|
19
|
+
*/
|
|
20
|
+
'aria-label'?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Provide the contents of your Modal
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Specify an optional className to be applied to the modal root node
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Specify an label for the close button of the modal; defaults to close
|
|
31
|
+
*/
|
|
32
|
+
closeButtonLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Specify whether the Modal is for dangerous actions
|
|
35
|
+
*/
|
|
36
|
+
danger?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* **Experimental**: Provide a decorator component to be rendered inside the `Modal` component
|
|
39
|
+
*/
|
|
40
|
+
decorator?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Specify whether the modal contains scrolling content
|
|
43
|
+
*/
|
|
44
|
+
hasScrollingContent?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Specify the DOM element ID of the top-level node.
|
|
47
|
+
*/
|
|
48
|
+
id?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Specify whether or not the Modal content should have any inner padding.
|
|
51
|
+
*/
|
|
52
|
+
isFullWidth?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Provide a ref to return focus to once the modal is closed.
|
|
55
|
+
*/
|
|
56
|
+
launcherButtonRef?: any;
|
|
57
|
+
/**
|
|
58
|
+
* Specify the description for the loading text
|
|
59
|
+
*/
|
|
60
|
+
loadingDescription?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Specify the description for the loading text
|
|
63
|
+
*/
|
|
64
|
+
loadingIconDescription?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Specify loading status
|
|
67
|
+
*/
|
|
68
|
+
loadingStatus?: InlineLoadingStatus;
|
|
69
|
+
/**
|
|
70
|
+
* Specify a label to be read by screen readers on the modal root node
|
|
71
|
+
*/
|
|
72
|
+
modalAriaLabel?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Specify the content of the modal header title.
|
|
75
|
+
*/
|
|
76
|
+
modalHeading?: ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* Specify the content of the modal header label.
|
|
79
|
+
*/
|
|
80
|
+
modalLabel?: ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Specify a handler for keypresses.
|
|
83
|
+
* @deprecated this property is unused
|
|
84
|
+
*/
|
|
85
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
86
|
+
/**
|
|
87
|
+
* Specify an optional handler to be invoked when loading is
|
|
88
|
+
* successful
|
|
89
|
+
*/
|
|
90
|
+
onLoadingSuccess?: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Specify a handler for closing modal.
|
|
93
|
+
* The handler should care of closing modal, e.g. changing `open` prop.
|
|
94
|
+
*/
|
|
95
|
+
onRequestClose?: React.ReactEventHandler<HTMLElement>;
|
|
96
|
+
/**
|
|
97
|
+
* Specify a handler for "submitting" modal.
|
|
98
|
+
* The handler should care of closing modal, e.g. changing `open` prop, if necessary.
|
|
99
|
+
*/
|
|
100
|
+
onRequestSubmit?: React.ReactEventHandler<HTMLElement>;
|
|
101
|
+
/**
|
|
102
|
+
* Specify a handler for the secondary button.
|
|
103
|
+
* Useful if separate handler from `onRequestClose` is desirable
|
|
104
|
+
*/
|
|
105
|
+
onSecondarySubmit?: React.ReactEventHandler<HTMLElement>;
|
|
106
|
+
/**
|
|
107
|
+
* Specify whether the Modal is currently open
|
|
108
|
+
*/
|
|
109
|
+
open?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Prevent closing on click outside of modal
|
|
112
|
+
*/
|
|
113
|
+
preventCloseOnClickOutside?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Specify whether the Button should be disabled, or not
|
|
116
|
+
*/
|
|
117
|
+
primaryButtonDisabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Specify the text for the primary button
|
|
120
|
+
*/
|
|
121
|
+
primaryButtonText?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Specify the text for the secondary button
|
|
124
|
+
*/
|
|
125
|
+
secondaryButtonText?: ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* Specify an array of config objects for secondary buttons
|
|
128
|
+
*/
|
|
129
|
+
secondaryButtons?: ModalSecondaryButton[];
|
|
130
|
+
/**
|
|
131
|
+
* Specify a CSS selector that matches the DOM element that should
|
|
132
|
+
* be focused when the Modal opens
|
|
133
|
+
*/
|
|
134
|
+
selectorPrimaryFocus?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Specify CSS selectors that match DOM elements working as floating menus.
|
|
137
|
+
* Focusing on those elements won't trigger "focus-wrap" behavior
|
|
138
|
+
*/
|
|
139
|
+
selectorsFloatingMenus?: string[];
|
|
140
|
+
/**
|
|
141
|
+
* Specify if Enter key should be used as "submit" action
|
|
142
|
+
*/
|
|
143
|
+
shouldSubmitOnEnter?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Specify the size variant.
|
|
146
|
+
*/
|
|
147
|
+
size?: ModalSize;
|
|
148
|
+
}
|
|
149
|
+
interface PassiveModal extends BaseModalProps {
|
|
150
|
+
/**
|
|
151
|
+
* Specify whether the modal should be button-less
|
|
152
|
+
*/
|
|
153
|
+
passiveModal?: true;
|
|
154
|
+
/**
|
|
155
|
+
* Specify whether the Modal is displaying an alert, error or warning. Should
|
|
156
|
+
* go hand in hand with the `danger` prop. This changes the `role` to
|
|
157
|
+
* `alertdialog` and cannot be used with passive modals.
|
|
158
|
+
*/
|
|
159
|
+
alert?: never;
|
|
160
|
+
}
|
|
161
|
+
interface NonPassiveModal extends BaseModalProps {
|
|
162
|
+
/**
|
|
163
|
+
* Specify whether the modal should be button-less
|
|
164
|
+
*/
|
|
165
|
+
passiveModal?: false;
|
|
166
|
+
/**
|
|
167
|
+
* Specify whether the Modal is displaying an alert, error or warning. Should
|
|
168
|
+
* go hand in hand with the `danger` prop. This changes the `role` to
|
|
169
|
+
* `alertdialog` and cannot be used with passive modals.
|
|
170
|
+
*/
|
|
171
|
+
alert?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export type ModalProps = PassiveModal | NonPassiveModal;
|
|
174
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
175
|
+
export default Modal;
|
|
@@ -63,7 +63,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
|
|
|
63
63
|
/**
|
|
64
64
|
* Default sorter is assigned if not provided.
|
|
65
65
|
*/
|
|
66
|
-
filterItems(items: readonly ItemType[], extra: {
|
|
66
|
+
filterItems?(items: readonly ItemType[], extra: {
|
|
67
67
|
inputValue: string | null;
|
|
68
68
|
itemToString: NonNullable<UseComboboxProps<ItemType>['itemToString']>;
|
|
69
69
|
}): ItemType[];
|
|
@@ -31,7 +31,6 @@ require('../FluidForm/FluidForm.js');
|
|
|
31
31
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
32
32
|
var Selection = require('../../internal/Selection.js');
|
|
33
33
|
var react = require('@floating-ui/react');
|
|
34
|
-
var floatingUi_dom = require('../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js');
|
|
35
34
|
var match = require('../../internal/keyboard/match.js');
|
|
36
35
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
37
36
|
var keys = require('../../internal/keyboard/keys.js');
|
|
@@ -159,7 +158,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
159
158
|
width: `${rects.reference.width}px`
|
|
160
159
|
});
|
|
161
160
|
}
|
|
162
|
-
}),
|
|
161
|
+
}), react.hide()],
|
|
163
162
|
whileElementsMounted: react.autoUpdate
|
|
164
163
|
} : {});
|
|
165
164
|
React.useLayoutEffect(() => {
|
|
@@ -30,7 +30,6 @@ var Checkbox = require('../Checkbox/Checkbox.js');
|
|
|
30
30
|
require('../Checkbox/Checkbox.Skeleton.js');
|
|
31
31
|
var noopFn = require('../../internal/noopFn.js');
|
|
32
32
|
var react = require('@floating-ui/react');
|
|
33
|
-
var floatingUi_dom = require('../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js');
|
|
34
33
|
var index = require('../FeatureFlags/index.js');
|
|
35
34
|
var match = require('../../internal/keyboard/match.js');
|
|
36
35
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
@@ -163,7 +162,7 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
163
162
|
width: `${rects.reference.width}px`
|
|
164
163
|
});
|
|
165
164
|
}
|
|
166
|
-
}), autoAlign &&
|
|
165
|
+
}), autoAlign && react.hide()],
|
|
167
166
|
whileElementsMounted: react.autoUpdate
|
|
168
167
|
} : {});
|
|
169
168
|
React.useLayoutEffect(() => {
|
|
@@ -20,7 +20,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var useEvent = require('../../internal/useEvent.js');
|
|
21
21
|
var createPropAdapter = require('../../tools/createPropAdapter.js');
|
|
22
22
|
var react = require('@floating-ui/react');
|
|
23
|
-
var floatingUi_dom = require('../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js');
|
|
24
23
|
var index = require('../FeatureFlags/index.js');
|
|
25
24
|
|
|
26
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -149,7 +148,7 @@ const Popover = /*#__PURE__*/React__default["default"].forwardRef(function Popov
|
|
|
149
148
|
boundary: autoAlignBoundary
|
|
150
149
|
}), react.arrow({
|
|
151
150
|
element: caretRef
|
|
152
|
-
}), autoAlign &&
|
|
151
|
+
}), autoAlign && react.hide()],
|
|
153
152
|
whileElementsMounted: react.autoUpdate
|
|
154
153
|
} : {}
|
|
155
154
|
// When autoAlign is turned off & the `enable-v12-dynamic-floating-styles` feature flag is not
|
|
@@ -245,7 +244,7 @@ const Popover = /*#__PURE__*/React__default["default"].forwardRef(function Popov
|
|
|
245
244
|
// For a popover, there isn't an explicit trigger component, it's just the first child that's
|
|
246
245
|
// passed in which should *not* be PopoverContent.
|
|
247
246
|
// For a toggletip there is a specific trigger component, ToggletipButton.
|
|
248
|
-
// In either of these
|
|
247
|
+
// In either of these cases we want to set this as the reference node for floating-ui autoAlign
|
|
249
248
|
// positioning.
|
|
250
249
|
if (enableFloatingStyles && item?.type?.displayName !== 'PopoverContent' || enableFloatingStyles && item?.type?.displayName === 'ToggletipButton') {
|
|
251
250
|
// Set the reference element for floating-ui
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const PrimaryButton: <T extends React.ElementType
|
|
9
|
+
declare const PrimaryButton: <T extends React.ElementType>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default PrimaryButton;
|
|
@@ -53,7 +53,7 @@ export interface RadioTileProps {
|
|
|
53
53
|
onChange?: (value: string | number, name: string | undefined, event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>) => void;
|
|
54
54
|
/**
|
|
55
55
|
* @deprecated please use `decorator` instead.
|
|
56
|
-
* **Experimental**: Provide a `Slug` component to be rendered inside the `
|
|
56
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `RadioTile` component
|
|
57
57
|
*/
|
|
58
58
|
slug?: React.ReactNode;
|
|
59
59
|
/**
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const SecondaryButton: <T extends React.ElementType
|
|
9
|
+
declare const SecondaryButton: <T extends React.ElementType>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default SecondaryButton;
|
|
@@ -387,7 +387,7 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
387
387
|
* Throttles calls to `this._onDrag` by limiting events to being processed at
|
|
388
388
|
* most once every `EVENT_THROTTLE` milliseconds.
|
|
389
389
|
*/
|
|
390
|
-
onDrag: import("es-toolkit/
|
|
390
|
+
onDrag: import("es-toolkit/compat").DebouncedFunc<(evt: any, activeHandle?: HandlePosition | null) => void>;
|
|
391
391
|
/**
|
|
392
392
|
* Handles a `keydown` event by recalculating the value/thumb and setting
|
|
393
393
|
* state accordingly.
|
|
@@ -13,7 +13,6 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var React = require('react');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
-
var compat = require('es-toolkit/compat');
|
|
17
16
|
var keys = require('../../internal/keyboard/keys.js');
|
|
18
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
18
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
@@ -23,6 +22,7 @@ require('../Text/index.js');
|
|
|
23
22
|
require('../Tooltip/DefinitionTooltip.js');
|
|
24
23
|
var Tooltip = require('../Tooltip/Tooltip.js');
|
|
25
24
|
var SliderHandles = require('./SliderHandles.js');
|
|
25
|
+
var throttle = require('../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js');
|
|
26
26
|
var match = require('../../internal/keyboard/match.js');
|
|
27
27
|
var Text = require('../Text/Text.js');
|
|
28
28
|
|
|
@@ -287,7 +287,7 @@ class Slider extends React.PureComponent {
|
|
|
287
287
|
* Throttles calls to `this._onDrag` by limiting events to being processed at
|
|
288
288
|
* most once every `EVENT_THROTTLE` milliseconds.
|
|
289
289
|
*/
|
|
290
|
-
_rollupPluginBabelHelpers.defineProperty(this, "onDrag",
|
|
290
|
+
_rollupPluginBabelHelpers.defineProperty(this, "onDrag", throttle.throttle(this._onDrag, EVENT_THROTTLE, {
|
|
291
291
|
leading: true,
|
|
292
292
|
trailing: false
|
|
293
293
|
}));
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
7
|
declare const Slider: import("react").FunctionComponent<import("./Slider").SliderProps>;
|
|
9
8
|
export { default as SliderSkeleton } from './Slider.Skeleton';
|
|
10
9
|
export default Slider;
|
|
@@ -265,7 +265,7 @@ export interface TabListVerticalProps extends DivAttributes {
|
|
|
265
265
|
* Provide an accessible label to be read when a user interacts with this
|
|
266
266
|
* component
|
|
267
267
|
*/
|
|
268
|
-
'aria-label'
|
|
268
|
+
'aria-label'?: string;
|
|
269
269
|
/**
|
|
270
270
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
271
271
|
* These elements should render a `ContentTab`
|
|
@@ -293,7 +293,7 @@ declare namespace TabListVertical {
|
|
|
293
293
|
* Provide an accessible label to be read when a user interacts with this
|
|
294
294
|
* component
|
|
295
295
|
*/
|
|
296
|
-
'aria-label': PropTypes.
|
|
296
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
297
297
|
/**
|
|
298
298
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
299
299
|
* These elements should render a `ContentTab`
|
|
@@ -348,7 +348,7 @@ export interface TabProps extends HTMLAttributes<HTMLElement> {
|
|
|
348
348
|
}>;
|
|
349
349
|
/**
|
|
350
350
|
* An optional label to render under the primary tab label.
|
|
351
|
-
* Only useful for
|
|
351
|
+
* Only useful for contained tabs.
|
|
352
352
|
*/
|
|
353
353
|
secondaryLabel?: string;
|
|
354
354
|
}
|
|
@@ -13,7 +13,6 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var iconsReact = require('@carbon/icons-react');
|
|
14
14
|
var layout = require('@carbon/layout');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
-
var compat = require('es-toolkit/compat');
|
|
17
16
|
var PropTypes = require('prop-types');
|
|
18
17
|
var React = require('react');
|
|
19
18
|
require('../Grid/FlexGrid.js');
|
|
@@ -37,6 +36,7 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
37
36
|
var useEvent = require('../../internal/useEvent.js');
|
|
38
37
|
var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
39
38
|
require('../Text/index.js');
|
|
39
|
+
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
|
|
40
40
|
var Text = require('../Text/Text.js');
|
|
41
41
|
var match = require('../../internal/keyboard/match.js');
|
|
42
42
|
var keys = require('../../internal/keyboard/keys.js');
|
|
@@ -325,7 +325,7 @@ function TabList(_ref4) {
|
|
|
325
325
|
});
|
|
326
326
|
const tabs = React.useRef([]);
|
|
327
327
|
const debouncedOnScroll = React.useCallback(() => {
|
|
328
|
-
return
|
|
328
|
+
return debounce.debounce(event => {
|
|
329
329
|
setScrollLeft(event.target.scrollLeft);
|
|
330
330
|
}, scrollDebounceWait);
|
|
331
331
|
}, [scrollDebounceWait]);
|
|
@@ -431,7 +431,7 @@ function TabList(_ref4) {
|
|
|
431
431
|
setIsScrollable(ref.current.scrollWidth > ref.current.clientWidth + 1);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
const debouncedHandler =
|
|
434
|
+
const debouncedHandler = debounce.debounce(handler, 200);
|
|
435
435
|
window.addEventListener('resize', debouncedHandler);
|
|
436
436
|
return () => {
|
|
437
437
|
debouncedHandler.cancel();
|
|
@@ -726,7 +726,7 @@ TabListVertical.propTypes = {
|
|
|
726
726
|
* Provide an accessible label to be read when a user interacts with this
|
|
727
727
|
* component
|
|
728
728
|
*/
|
|
729
|
-
'aria-label': PropTypes__default["default"].string
|
|
729
|
+
'aria-label': PropTypes__default["default"].string,
|
|
730
730
|
/**
|
|
731
731
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
732
732
|
* These elements should render a `ContentTab`
|
|
@@ -909,7 +909,7 @@ const Tab = /*#__PURE__*/React.forwardRef(function Tab(_ref10, forwardRef) {
|
|
|
909
909
|
})));
|
|
910
910
|
const hasIcon = Icon ?? dismissable;
|
|
911
911
|
|
|
912
|
-
// should only happen for vertical variation, so no
|
|
912
|
+
// should only happen for vertical variation, so no dismissable icon is needed here
|
|
913
913
|
if (isEllipsisApplied) {
|
|
914
914
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip.Tooltip, {
|
|
915
915
|
label: children,
|
|
@@ -1027,7 +1027,7 @@ Tab.propTypes = {
|
|
|
1027
1027
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
1028
1028
|
/*
|
|
1029
1029
|
* An optional label to render under the primary tab label.
|
|
1030
|
-
/* This prop is only useful for
|
|
1030
|
+
/* This prop is only useful for contained tabs
|
|
1031
1031
|
**/
|
|
1032
1032
|
secondaryLabel: PropTypes__default["default"].string
|
|
1033
1033
|
};
|
|
@@ -22,7 +22,7 @@ export interface DismissibleTagBaseProps {
|
|
|
22
22
|
*/
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Specify the id for the
|
|
25
|
+
* Specify the id for the selectable tag.
|
|
26
26
|
*/
|
|
27
27
|
id?: string;
|
|
28
28
|
/**
|
|
@@ -63,7 +63,7 @@ export interface DismissibleTagBaseProps {
|
|
|
63
63
|
}
|
|
64
64
|
export type DismissibleTagProps<T extends React.ElementType> = PolymorphicProps<T, DismissibleTagBaseProps>;
|
|
65
65
|
declare const DismissibleTag: {
|
|
66
|
-
<T extends React.ElementType
|
|
66
|
+
<T extends React.ElementType>({ className, decorator, disabled, id, renderIcon, title, onClose, slug, size, text, tagTitle, type, ...other }: DismissibleTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
67
67
|
propTypes: {
|
|
68
68
|
/**
|
|
69
69
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -55,7 +55,7 @@ export interface OperationalTagBaseProps {
|
|
|
55
55
|
}
|
|
56
56
|
export type OperationalTagProps<T extends React.ElementType> = PolymorphicProps<T, OperationalTagBaseProps>;
|
|
57
57
|
declare const OperationalTag: {
|
|
58
|
-
<T extends React.ElementType
|
|
58
|
+
<T extends React.ElementType>({ className, disabled, id, renderIcon, size, text, type, ...other }: OperationalTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
59
59
|
propTypes: {
|
|
60
60
|
/**
|
|
61
61
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -18,7 +18,7 @@ export interface SelectableTagBaseProps {
|
|
|
18
18
|
*/
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Specify the id for the
|
|
21
|
+
* Specify the id for the selectable tag.
|
|
22
22
|
*/
|
|
23
23
|
id?: string;
|
|
24
24
|
/**
|
|
@@ -50,7 +50,7 @@ export interface SelectableTagBaseProps {
|
|
|
50
50
|
}
|
|
51
51
|
export type SelectableTagProps<T extends React.ElementType> = PolymorphicProps<T, SelectableTagBaseProps>;
|
|
52
52
|
declare const SelectableTag: {
|
|
53
|
-
<T extends React.ElementType
|
|
53
|
+
<T extends React.ElementType>({ className, disabled, id, renderIcon, onChange, onClick, selected, size, text, ...other }: SelectableTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
propTypes: {
|
|
55
55
|
/**
|
|
56
56
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -9,10 +9,10 @@ import { Text, TextBaseProps, TextProps } from './Text';
|
|
|
9
9
|
export { TextDirection, Text };
|
|
10
10
|
export type { TextBaseProps, TextProps, TextDirectionProps, GetTextDirection, TextDir, };
|
|
11
11
|
export declare const Label: {
|
|
12
|
-
(props: TextProps<
|
|
12
|
+
(props: TextProps<React.ElementType>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const Legend: {
|
|
16
|
-
(props: TextProps<
|
|
16
|
+
(props: TextProps<React.ElementType>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
@@ -2,7 +2,7 @@ import React, { InputHTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
type ExcludedAttributes = 'size';
|
|
3
3
|
export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
|
|
4
4
|
/**
|
|
5
|
-
* Provide a custom className that is applied directly to the
|
|
5
|
+
* Provide a custom className that is applied directly to the underlying `<input>` node
|
|
6
6
|
*/
|
|
7
7
|
className?: string;
|
|
8
8
|
/**
|
|
@@ -13,7 +13,7 @@ export interface GlobalThemeProps {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const ThemeContext: React.Context<GlobalThemeProps>;
|
|
15
15
|
export declare const GlobalTheme: React.ForwardRefExoticComponent<GlobalThemeProps & {
|
|
16
|
-
children?: React.ReactNode;
|
|
16
|
+
children?: React.ReactNode | undefined;
|
|
17
17
|
} & React.RefAttributes<unknown>>;
|
|
18
18
|
type ThemeBaseProps = GlobalThemeProps & {
|
|
19
19
|
className?: string;
|
|
@@ -10,7 +10,7 @@ export interface TileProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
light?: boolean;
|
|
11
11
|
/**
|
|
12
12
|
* **Experimental**: Specify if the `Tile` component should be rendered with rounded corners. Only valid
|
|
13
|
-
* when
|
|
13
|
+
* when an AILabel is present
|
|
14
14
|
*/
|
|
15
15
|
hasRoundedCorners?: boolean;
|
|
16
16
|
/**
|
|
@@ -76,7 +76,7 @@ Tile.propTypes = {
|
|
|
76
76
|
decorator: PropTypes__default["default"].node,
|
|
77
77
|
/**
|
|
78
78
|
* **Experimental**: Specify if the `Tile` component should be rendered with rounded corners. Only valid
|
|
79
|
-
* when
|
|
79
|
+
* when an AILabel is present
|
|
80
80
|
*/
|
|
81
81
|
hasRoundedCorners: PropTypes__default["default"].bool,
|
|
82
82
|
/**
|
|
@@ -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.
|
|
@@ -12,11 +12,11 @@ type ToggletipLabelProps<E extends ElementType> = {
|
|
|
12
12
|
as?: E;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
className?: string;
|
|
15
|
-
}
|
|
15
|
+
} & Omit<React.ComponentPropsWithoutRef<E>, 'as' | 'children' | 'className'>;
|
|
16
16
|
/**
|
|
17
17
|
* Used to render the label for a Toggletip
|
|
18
18
|
*/
|
|
19
|
-
export declare function ToggletipLabel<E extends ElementType>({ as: BaseComponent, children, className: customClassName, }: ToggletipLabelProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function ToggletipLabel<E extends ElementType>({ as: BaseComponent, children, className: customClassName, ...rest }: ToggletipLabelProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare namespace ToggletipLabel {
|
|
21
21
|
var propTypes: {
|
|
22
22
|
/**
|
|
@@ -33,14 +33,15 @@ function ToggletipLabel(_ref) {
|
|
|
33
33
|
let {
|
|
34
34
|
as: BaseComponent = 'span',
|
|
35
35
|
children,
|
|
36
|
-
className: customClassName
|
|
36
|
+
className: customClassName,
|
|
37
|
+
...rest
|
|
37
38
|
} = _ref;
|
|
38
39
|
const prefix = usePrefix.usePrefix();
|
|
39
40
|
const className = cx__default["default"](`${prefix}--toggletip-label`, customClassName);
|
|
40
41
|
const BaseComponentAsAny = BaseComponent;
|
|
41
|
-
return /*#__PURE__*/React__default["default"].createElement(BaseComponentAsAny, {
|
|
42
|
+
return /*#__PURE__*/React__default["default"].createElement(BaseComponentAsAny, _rollupPluginBabelHelpers["extends"]({
|
|
42
43
|
className: className
|
|
43
|
-
}, children);
|
|
44
|
+
}, rest), children);
|
|
44
45
|
}
|
|
45
46
|
ToggletipLabel.propTypes = {
|
|
46
47
|
/**
|
|
@@ -130,7 +131,7 @@ function Toggletip(_ref2) {
|
|
|
130
131
|
}
|
|
131
132
|
};
|
|
132
133
|
|
|
133
|
-
// If the `Toggletip` is the last focusable item in the tab order, it
|
|
134
|
+
// If the `Toggletip` is the last focusable item in the tab order, it should also close when the browser window loses focus (#12922)
|
|
134
135
|
useEvent.useWindowEvent('blur', () => {
|
|
135
136
|
if (open) {
|
|
136
137
|
actions.close();
|
|
@@ -40,10 +40,18 @@ interface TooltipBaseProps {
|
|
|
40
40
|
* description will not be used
|
|
41
41
|
*/
|
|
42
42
|
description?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Specify whether a drop shadow should be rendered
|
|
45
|
+
*/
|
|
46
|
+
dropShadow?: boolean;
|
|
43
47
|
/**
|
|
44
48
|
* Specify the duration in milliseconds to delay before displaying the tooltip
|
|
45
49
|
*/
|
|
46
50
|
enterDelayMs?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Render the component using the high-contrast theme
|
|
53
|
+
*/
|
|
54
|
+
highContrast?: boolean;
|
|
47
55
|
/**
|
|
48
56
|
* Provide the label to be rendered inside of the Tooltip. The label will use
|
|
49
57
|
* `aria-labelledby` and will fully describe the child node that is provided.
|
|
@@ -60,7 +68,7 @@ interface TooltipBaseProps {
|
|
|
60
68
|
leaveDelayMs?: number;
|
|
61
69
|
}
|
|
62
70
|
export type TooltipProps<T extends React.ElementType> = PolymorphicProps<T, TooltipBaseProps>;
|
|
63
|
-
declare function Tooltip<T extends React.ElementType>({ align, className: customClassName, children, label, description, enterDelayMs, leaveDelayMs, defaultOpen, closeOnActivation, ...rest }: TooltipProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
declare function Tooltip<T extends React.ElementType>({ align, className: customClassName, children, label, description, enterDelayMs, leaveDelayMs, defaultOpen, closeOnActivation, dropShadow, highContrast, ...rest }: TooltipProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
64
72
|
declare namespace Tooltip {
|
|
65
73
|
var propTypes: {
|
|
66
74
|
/**
|
|
@@ -94,10 +102,18 @@ declare namespace Tooltip {
|
|
|
94
102
|
* description will not be used
|
|
95
103
|
*/
|
|
96
104
|
description: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
105
|
+
/**
|
|
106
|
+
* Specify whether a drop shadow should be rendered
|
|
107
|
+
*/
|
|
108
|
+
dropShadow: PropTypes.Requireable<boolean>;
|
|
97
109
|
/**
|
|
98
110
|
* Specify the duration in milliseconds to delay before displaying the tooltip
|
|
99
111
|
*/
|
|
100
112
|
enterDelayMs: PropTypes.Requireable<number>;
|
|
113
|
+
/**
|
|
114
|
+
* Render the component using the high-contrast theme
|
|
115
|
+
*/
|
|
116
|
+
highContrast: PropTypes.Requireable<boolean>;
|
|
101
117
|
/**
|
|
102
118
|
* Provide the label to be rendered inside of the Tooltip. The label will use
|
|
103
119
|
* `aria-labelledby` and will fully describe the child node that is provided.
|
|
@@ -43,6 +43,8 @@ function Tooltip(_ref) {
|
|
|
43
43
|
leaveDelayMs = 300,
|
|
44
44
|
defaultOpen = false,
|
|
45
45
|
closeOnActivation = false,
|
|
46
|
+
dropShadow = false,
|
|
47
|
+
highContrast = true,
|
|
46
48
|
...rest
|
|
47
49
|
} = _ref;
|
|
48
50
|
const tooltipRef = React.useRef(null);
|
|
@@ -164,8 +166,8 @@ function Tooltip(_ref) {
|
|
|
164
166
|
React__default["default"].createElement(index.Popover, _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
165
167
|
align: align,
|
|
166
168
|
className: cx__default["default"](`${prefix}--tooltip`, customClassName),
|
|
167
|
-
dropShadow:
|
|
168
|
-
highContrast:
|
|
169
|
+
dropShadow: dropShadow,
|
|
170
|
+
highContrast: highContrast,
|
|
169
171
|
onKeyDown: onKeyDown,
|
|
170
172
|
onMouseLeave: onMouseLeave,
|
|
171
173
|
open: open
|
|
@@ -236,10 +238,18 @@ Tooltip.propTypes = {
|
|
|
236
238
|
* description will not be used
|
|
237
239
|
*/
|
|
238
240
|
description: PropTypes__default["default"].node,
|
|
241
|
+
/**
|
|
242
|
+
* Specify whether a drop shadow should be rendered
|
|
243
|
+
*/
|
|
244
|
+
dropShadow: PropTypes__default["default"].bool,
|
|
239
245
|
/**
|
|
240
246
|
* Specify the duration in milliseconds to delay before displaying the tooltip
|
|
241
247
|
*/
|
|
242
248
|
enterDelayMs: PropTypes__default["default"].number,
|
|
249
|
+
/**
|
|
250
|
+
* Render the component using the high-contrast theme
|
|
251
|
+
*/
|
|
252
|
+
highContrast: PropTypes__default["default"].bool,
|
|
243
253
|
/**
|
|
244
254
|
* Provide the label to be rendered inside of the Tooltip. The label will use
|
|
245
255
|
* `aria-labelledby` and will fully describe the child node that is provided.
|