@carbon/react 1.81.0 → 1.82.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 +892 -892
- package/es/components/AILabel/index.d.ts +1 -1
- package/es/components/AILabel/index.js +2 -9
- package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/es/components/Breadcrumb/Breadcrumb.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
- package/es/components/Button/Button.js +2 -10
- package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/es/components/ButtonSet/ButtonSet.js +4 -4
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +3 -19
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +2 -2
- package/es/components/ComboButton/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +2 -18
- package/es/components/ComposedModal/ComposedModal.js +5 -3
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +2 -18
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +2 -18
- package/es/components/DataTable/DataTable.d.ts +7 -12
- package/es/components/DataTable/DataTable.js +0 -5
- package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/es/components/DataTable/TableToolbarAction.js +5 -4
- package/es/components/DataTable/tools/sorting.d.ts +42 -0
- package/es/components/DataTable/tools/sorting.js +24 -53
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +18 -18
- package/es/components/Dialog/index.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +7 -6
- package/es/components/Dropdown/Dropdown.js +7 -3
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -18
- package/es/components/ListBox/ListBox.d.ts +4 -5
- package/es/components/ListBox/ListBox.js +8 -7
- package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/es/components/ListBox/ListBoxMenu.js +4 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/es/components/ListBox/ListBoxPropTypes.js +3 -3
- package/es/components/ListBox/index.d.ts +7 -5
- package/es/components/ListBox/index.js +1 -1
- package/es/components/Menu/Menu.js +5 -0
- package/es/components/Modal/Modal.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/es/components/MultiSelect/MultiSelect.js +3 -3
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +2 -21
- package/es/components/OverflowMenu/next/index.js +2 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
- package/es/components/PageHeader/PageHeader.d.ts +153 -8
- package/es/components/PageHeader/PageHeader.js +143 -21
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Popover/index.js +4 -21
- package/es/components/Search/Search.d.ts +2 -5
- package/es/components/Search/Search.js +24 -8
- package/es/components/Stack/HStack.d.ts +2 -3
- package/es/components/Stack/HStack.js +4 -7
- package/es/components/Stack/Stack.d.ts +3 -4
- package/es/components/Stack/Stack.js +3 -6
- package/es/components/Stack/VStack.d.ts +2 -3
- package/es/components/Stack/VStack.js +3 -2
- package/es/components/Stack/index.d.ts +4 -4
- package/es/components/TextArea/TextArea.js +3 -5
- package/es/components/TimePicker/TimePicker.d.ts +3 -4
- package/es/components/TimePicker/TimePicker.js +5 -4
- package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
- package/es/components/TreeView/TreeNode.js +13 -1
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +9 -5
- package/es/internal/environment.js +7 -0
- package/es/internal/keyboard/navigation.d.ts +0 -10
- package/es/internal/keyboard/navigation.js +1 -13
- package/es/internal/useId.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +7 -0
- package/es/internal/useOutsideClick.js +3 -0
- package/es/internal/wrapFocus.d.ts +49 -0
- package/es/internal/wrapFocus.js +64 -51
- package/es/tools/events.d.ts +17 -0
- package/es/tools/events.js +10 -13
- package/es/tools/mapPopoverAlign.d.ts +15 -0
- package/es/tools/mapPopoverAlign.js +28 -0
- package/es/tools/uniqueId.d.ts +7 -0
- package/es/tools/uniqueId.js +3 -3
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.d.ts +1 -1
- package/lib/components/AILabel/index.js +2 -9
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
- package/lib/components/Button/Button.js +1 -9
- package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/lib/components/ButtonSet/ButtonSet.js +3 -3
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboButton/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +2 -18
- package/lib/components/ComposedModal/ComposedModal.js +5 -3
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +2 -18
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +2 -18
- package/lib/components/DataTable/DataTable.d.ts +7 -12
- package/lib/components/DataTable/DataTable.js +0 -5
- package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/lib/components/DataTable/TableToolbarAction.js +4 -3
- package/lib/components/DataTable/tools/sorting.d.ts +42 -0
- package/lib/components/DataTable/tools/sorting.js +23 -53
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +18 -18
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +7 -6
- package/lib/components/Dropdown/Dropdown.js +6 -2
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +2 -18
- package/lib/components/ListBox/ListBox.d.ts +4 -5
- package/lib/components/ListBox/ListBox.js +7 -6
- package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/lib/components/ListBox/ListBoxMenu.js +3 -1
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/index.d.ts +7 -5
- package/lib/components/ListBox/index.js +2 -2
- package/lib/components/Menu/Menu.js +5 -0
- package/lib/components/Modal/Modal.js +9 -9
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
- package/lib/components/OverflowMenu/next/index.js +2 -18
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/lib/components/PageHeader/PageHeader.d.ts +153 -8
- package/lib/components/PageHeader/PageHeader.js +145 -19
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +4 -0
- package/lib/components/Popover/index.js +4 -21
- package/lib/components/Search/Search.d.ts +2 -5
- package/lib/components/Search/Search.js +24 -8
- package/lib/components/Stack/HStack.d.ts +2 -3
- package/lib/components/Stack/HStack.js +3 -6
- package/lib/components/Stack/Stack.d.ts +3 -4
- package/lib/components/Stack/Stack.js +2 -5
- package/lib/components/Stack/VStack.d.ts +2 -3
- package/lib/components/Stack/VStack.js +2 -1
- package/lib/components/Stack/index.d.ts +4 -4
- package/lib/components/TextArea/TextArea.js +2 -4
- package/lib/components/TimePicker/TimePicker.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.js +4 -3
- package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
- package/lib/components/TreeView/TreeNode.js +13 -1
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +9 -5
- package/lib/internal/environment.js +7 -0
- package/lib/internal/keyboard/navigation.d.ts +0 -10
- package/lib/internal/keyboard/navigation.js +0 -14
- package/lib/internal/useNoInteractiveChildren.js +7 -0
- package/lib/internal/useOutsideClick.js +3 -0
- package/lib/internal/wrapFocus.d.ts +49 -0
- package/lib/internal/wrapFocus.js +66 -53
- package/lib/tools/events.d.ts +17 -0
- package/lib/tools/events.js +10 -13
- package/lib/tools/mapPopoverAlign.d.ts +15 -0
- package/lib/tools/mapPopoverAlign.js +32 -0
- package/lib/tools/uniqueId.d.ts +7 -0
- package/lib/tools/uniqueId.js +3 -3
- package/lib/types/common.d.ts +0 -2
- package/package.json +7 -7
- package/telemetry.yml +3 -1
- package/es/tools/createPropAdapter.js +0 -40
- package/lib/tools/createPropAdapter.js +0 -44
|
@@ -17,9 +17,13 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
17
17
|
var layout = require('@carbon/layout');
|
|
18
18
|
var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
19
19
|
require('../Text/index.js');
|
|
20
|
+
var index = require('../MenuButton/index.js');
|
|
21
|
+
require('../Menu/Menu.js');
|
|
22
|
+
var MenuItem = require('../Menu/MenuItem.js');
|
|
20
23
|
var DefinitionTooltip = require('../Tooltip/DefinitionTooltip.js');
|
|
21
24
|
require('../Tooltip/Tooltip.js');
|
|
22
25
|
var AspectRatio = require('../AspectRatio/AspectRatio.js');
|
|
26
|
+
var utilities = require('@carbon/utilities');
|
|
23
27
|
var Tabs$1 = require('../Tabs/Tabs.js');
|
|
24
28
|
var Text = require('../Text/Text.js');
|
|
25
29
|
|
|
@@ -88,7 +92,6 @@ const PageHeaderContent = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
|
88
92
|
className,
|
|
89
93
|
children,
|
|
90
94
|
title,
|
|
91
|
-
subtitle,
|
|
92
95
|
renderIcon: IconElement,
|
|
93
96
|
contextualActions,
|
|
94
97
|
pageActions,
|
|
@@ -130,16 +133,7 @@ const PageHeaderContent = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
|
130
133
|
className: `${prefix}--page-header__content__title`
|
|
131
134
|
}, title)), contextualActions && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
132
135
|
className: `${prefix}--page-header__content__contextual-actions`
|
|
133
|
-
}, contextualActions)),
|
|
134
|
-
className: `${prefix}--page-header__content__end`
|
|
135
|
-
}, pageActions && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
136
|
-
className: `${prefix}--page-header__content__page-actions`
|
|
137
|
-
}, pageActions))), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
138
|
-
as: "h3",
|
|
139
|
-
className: `${prefix}--page-header__content__subtitle`
|
|
140
|
-
}, subtitle), children && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
141
|
-
className: `${prefix}--page-header__content__body`
|
|
142
|
-
}, children));
|
|
136
|
+
}, contextualActions)), pageActions), children);
|
|
143
137
|
});
|
|
144
138
|
PageHeaderContent.displayName = 'PageHeaderContent';
|
|
145
139
|
PageHeaderContent.propTypes = {
|
|
@@ -154,7 +148,6 @@ PageHeaderContent.propTypes = {
|
|
|
154
148
|
/**
|
|
155
149
|
* Provide an optional icon to render in front of the PageHeaderContent's title.
|
|
156
150
|
*/
|
|
157
|
-
|
|
158
151
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
159
152
|
/**
|
|
160
153
|
* The PageHeaderContent's title
|
|
@@ -176,17 +169,142 @@ PageHeaderContent.propTypes = {
|
|
|
176
169
|
|
|
177
170
|
/**
|
|
178
171
|
* ----------------
|
|
179
|
-
*
|
|
172
|
+
* PageHeaderContentPageActions
|
|
180
173
|
* ----------------
|
|
181
174
|
*/
|
|
182
175
|
|
|
183
|
-
const
|
|
176
|
+
const PageHeaderContentPageActions = _ref4 => {
|
|
184
177
|
let {
|
|
185
178
|
className,
|
|
186
179
|
children,
|
|
180
|
+
menuButtonLabel = 'Actions',
|
|
181
|
+
pageActions,
|
|
187
182
|
...other
|
|
188
183
|
} = _ref4;
|
|
189
184
|
const prefix = usePrefix.usePrefix();
|
|
185
|
+
const classNames = cx__default["default"]({
|
|
186
|
+
[`${prefix}--page-header__content__page-actions`]: true
|
|
187
|
+
}, className);
|
|
188
|
+
const containerRef = React.useRef(null);
|
|
189
|
+
const offsetRef = React.useRef(null);
|
|
190
|
+
const [menuButtonVisibility, setMenuButtonVisibility] = React.useState(false);
|
|
191
|
+
const [hiddenItems, setHiddenItems] = React.useState([]);
|
|
192
|
+
|
|
193
|
+
// need to set the grid columns width based on the menu button's width
|
|
194
|
+
// to avoid overlapping when resizing
|
|
195
|
+
React.useLayoutEffect(() => {
|
|
196
|
+
if (menuButtonVisibility && offsetRef.current) {
|
|
197
|
+
const width = offsetRef.current.offsetWidth;
|
|
198
|
+
document.documentElement.style.setProperty('--pageheader-title-grid-width', `${width}px`);
|
|
199
|
+
}
|
|
200
|
+
}, [menuButtonVisibility]);
|
|
201
|
+
React.useEffect(() => {
|
|
202
|
+
if (!containerRef.current || !Array.isArray(pageActions)) return;
|
|
203
|
+
utilities.createOverflowHandler({
|
|
204
|
+
container: containerRef.current,
|
|
205
|
+
// exclude the hidden menu button from children
|
|
206
|
+
maxVisibleItems: containerRef.current.children.length - 1,
|
|
207
|
+
onChange: (visible, hidden) => {
|
|
208
|
+
setHiddenItems(pageActions?.slice(visible.length));
|
|
209
|
+
if (hidden.length > 0) {
|
|
210
|
+
setMenuButtonVisibility(true);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}, []);
|
|
215
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
216
|
+
className: classNames,
|
|
217
|
+
ref: containerRef
|
|
218
|
+
}, other), pageActions && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Array.isArray(pageActions) && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, pageActions.map(action => /*#__PURE__*/React__default["default"].createElement("div", {
|
|
219
|
+
key: action.id,
|
|
220
|
+
className: "action"
|
|
221
|
+
}, action.body)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
222
|
+
"data-offset": true,
|
|
223
|
+
"data-hidden": true,
|
|
224
|
+
ref: offsetRef
|
|
225
|
+
}, /*#__PURE__*/React__default["default"].createElement(index.MenuButton, {
|
|
226
|
+
menuAlignment: "bottom-end",
|
|
227
|
+
label: menuButtonLabel,
|
|
228
|
+
size: "md"
|
|
229
|
+
}, [...hiddenItems].reverse().map(item => /*#__PURE__*/React__default["default"].createElement(MenuItem.MenuItem, {
|
|
230
|
+
key: item.id,
|
|
231
|
+
label: item.label,
|
|
232
|
+
onClick: item.onClick
|
|
233
|
+
})))))));
|
|
234
|
+
};
|
|
235
|
+
PageHeaderContentPageActions.displayName = 'PageHeaderContentPageActions';
|
|
236
|
+
PageHeaderContentPageActions.propTypes = {
|
|
237
|
+
/**
|
|
238
|
+
* Provide child elements to be rendered inside PageHeaderContentPageActions.
|
|
239
|
+
*/
|
|
240
|
+
children: PropTypes__default["default"].node,
|
|
241
|
+
/**
|
|
242
|
+
* Specify an optional className to be added to your PageHeaderContentPageActions
|
|
243
|
+
*/
|
|
244
|
+
className: PropTypes__default["default"].string,
|
|
245
|
+
/**
|
|
246
|
+
* The PageHeaderContent's collapsible Menu button label
|
|
247
|
+
*/
|
|
248
|
+
menuButtonLabel: PropTypes__default["default"].string,
|
|
249
|
+
/**
|
|
250
|
+
* The PageHeaderContent's page actions
|
|
251
|
+
*/
|
|
252
|
+
pageActions: PropTypes__default["default"].oneOfType([PropTypes__default["default"].node, PropTypes__default["default"].array])
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* ----------------
|
|
257
|
+
* PageHeaderContentText
|
|
258
|
+
* ----------------
|
|
259
|
+
*/
|
|
260
|
+
|
|
261
|
+
const PageHeaderContentText = _ref5 => {
|
|
262
|
+
let {
|
|
263
|
+
className,
|
|
264
|
+
children,
|
|
265
|
+
subtitle,
|
|
266
|
+
...other
|
|
267
|
+
} = _ref5;
|
|
268
|
+
const prefix = usePrefix.usePrefix();
|
|
269
|
+
const classNames = cx__default["default"]({
|
|
270
|
+
[`${prefix}--page-header__content__body`]: true
|
|
271
|
+
}, className);
|
|
272
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
273
|
+
className: classNames
|
|
274
|
+
}, other), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
275
|
+
as: "h3",
|
|
276
|
+
className: `${prefix}--page-header__content__subtitle`
|
|
277
|
+
}, subtitle), children);
|
|
278
|
+
};
|
|
279
|
+
PageHeaderContentText.displayName = 'PageHeaderContentText';
|
|
280
|
+
PageHeaderContentText.propTypes = {
|
|
281
|
+
/**
|
|
282
|
+
* Provide child elements to be rendered inside PageHeaderContentText.
|
|
283
|
+
*/
|
|
284
|
+
children: PropTypes__default["default"].node,
|
|
285
|
+
/**
|
|
286
|
+
* Specify an optional className to be added to your PageHeaderContentText
|
|
287
|
+
*/
|
|
288
|
+
className: PropTypes__default["default"].string,
|
|
289
|
+
/**
|
|
290
|
+
* The PageHeaderContent's subtitle
|
|
291
|
+
*/
|
|
292
|
+
subtitle: PropTypes__default["default"].string
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* ----------------
|
|
297
|
+
* PageHeaderHeroImage
|
|
298
|
+
* ----------------
|
|
299
|
+
*/
|
|
300
|
+
|
|
301
|
+
const PageHeaderHeroImage = _ref6 => {
|
|
302
|
+
let {
|
|
303
|
+
className,
|
|
304
|
+
children,
|
|
305
|
+
...other
|
|
306
|
+
} = _ref6;
|
|
307
|
+
const prefix = usePrefix.usePrefix();
|
|
190
308
|
const classNames = cx__default["default"]({
|
|
191
309
|
[`${prefix}--page-header__hero-image`]: true
|
|
192
310
|
}, className);
|
|
@@ -197,7 +315,7 @@ const PageHeaderHeroImage = /*#__PURE__*/React__default["default"].forwardRef(fu
|
|
|
197
315
|
}, other, {
|
|
198
316
|
ratio: isLg ? '2x1' : '3x2'
|
|
199
317
|
}), children);
|
|
200
|
-
}
|
|
318
|
+
};
|
|
201
319
|
PageHeaderHeroImage.displayName = 'PageHeaderHeroImage';
|
|
202
320
|
PageHeaderHeroImage.propTypes = {
|
|
203
321
|
/**
|
|
@@ -216,12 +334,12 @@ PageHeaderHeroImage.propTypes = {
|
|
|
216
334
|
* ----------------
|
|
217
335
|
*/
|
|
218
336
|
|
|
219
|
-
const PageHeaderTabBar = /*#__PURE__*/React__default["default"].forwardRef(function PageHeaderTabBar(
|
|
337
|
+
const PageHeaderTabBar = /*#__PURE__*/React__default["default"].forwardRef(function PageHeaderTabBar(_ref7, ref) {
|
|
220
338
|
let {
|
|
221
339
|
className,
|
|
222
340
|
children,
|
|
223
341
|
...other
|
|
224
|
-
} =
|
|
342
|
+
} = _ref7;
|
|
225
343
|
const prefix = usePrefix.usePrefix();
|
|
226
344
|
const classNames = cx__default["default"]({
|
|
227
345
|
[`${prefix}--page-header__tab-bar`]: true
|
|
@@ -232,12 +350,12 @@ const PageHeaderTabBar = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
|
232
350
|
}, other), children);
|
|
233
351
|
});
|
|
234
352
|
PageHeaderTabBar.displayName = 'PageHeaderTabBar';
|
|
235
|
-
const PageHeaderTabs = /*#__PURE__*/React__default["default"].forwardRef(function PageHeaderTabs(
|
|
353
|
+
const PageHeaderTabs = /*#__PURE__*/React__default["default"].forwardRef(function PageHeaderTabs(_ref8, ref) {
|
|
236
354
|
let {
|
|
237
355
|
className,
|
|
238
356
|
children,
|
|
239
357
|
...other
|
|
240
|
-
} =
|
|
358
|
+
} = _ref8;
|
|
241
359
|
return /*#__PURE__*/React__default["default"].createElement(Tabs$1.Tabs, other, children);
|
|
242
360
|
});
|
|
243
361
|
PageHeaderTabs.displayName = 'PageHeaderTabs';
|
|
@@ -253,6 +371,10 @@ const BreadcrumbBar = PageHeaderBreadcrumbBar;
|
|
|
253
371
|
BreadcrumbBar.displayName = 'PageHeaderBreadcrumbBar';
|
|
254
372
|
const Content = PageHeaderContent;
|
|
255
373
|
Content.displayName = 'PageHeaderContent';
|
|
374
|
+
const ContentPageActions = PageHeaderContentPageActions;
|
|
375
|
+
Content.displayName = 'PageHeaderContentPageActions';
|
|
376
|
+
const ContentText = PageHeaderContentText;
|
|
377
|
+
Content.displayName = 'PageHeaderContentText';
|
|
256
378
|
const HeroImage = PageHeaderHeroImage;
|
|
257
379
|
HeroImage.displayName = 'PageHeaderHeroImage';
|
|
258
380
|
const TabBar = PageHeaderTabBar;
|
|
@@ -262,10 +384,14 @@ Tabs.displayName = 'PageHeader.Tabs';
|
|
|
262
384
|
|
|
263
385
|
exports.BreadcrumbBar = BreadcrumbBar;
|
|
264
386
|
exports.Content = Content;
|
|
387
|
+
exports.ContentPageActions = ContentPageActions;
|
|
388
|
+
exports.ContentText = ContentText;
|
|
265
389
|
exports.HeroImage = HeroImage;
|
|
266
390
|
exports.PageHeader = PageHeader;
|
|
267
391
|
exports.PageHeaderBreadcrumbBar = PageHeaderBreadcrumbBar;
|
|
268
392
|
exports.PageHeaderContent = PageHeaderContent;
|
|
393
|
+
exports.PageHeaderContentPageActions = PageHeaderContentPageActions;
|
|
394
|
+
exports.PageHeaderContentText = PageHeaderContentText;
|
|
269
395
|
exports.PageHeaderHeroImage = PageHeaderHeroImage;
|
|
270
396
|
exports.PageHeaderTabBar = PageHeaderTabBar;
|
|
271
397
|
exports.PageHeaderTabs = PageHeaderTabs;
|
|
@@ -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
|
-
export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderTabBar, PageHeaderHeroImage, PageHeaderTabs, Root, BreadcrumbBar, Content, TabBar, HeroImage, Tabs, } from './PageHeader';
|
|
8
|
-
export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderTabBarProps, PageHeaderHeroImageProps, PageHeaderTabsProps, } from './PageHeader';
|
|
7
|
+
export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderTabBar, PageHeaderHeroImage, PageHeaderTabs, Root, BreadcrumbBar, Content, ContentPageActions, ContentText, TabBar, HeroImage, Tabs, } from './PageHeader';
|
|
8
|
+
export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderContentPageActionsProps, PageHeaderContentTextProps, PageHeaderTabBarProps, PageHeaderHeroImageProps, PageHeaderTabsProps, } from './PageHeader';
|
|
@@ -15,10 +15,14 @@ var PageHeader = require('./PageHeader.js');
|
|
|
15
15
|
|
|
16
16
|
exports.BreadcrumbBar = PageHeader.BreadcrumbBar;
|
|
17
17
|
exports.Content = PageHeader.Content;
|
|
18
|
+
exports.ContentPageActions = PageHeader.ContentPageActions;
|
|
19
|
+
exports.ContentText = PageHeader.ContentText;
|
|
18
20
|
exports.HeroImage = PageHeader.HeroImage;
|
|
19
21
|
exports.PageHeader = PageHeader.PageHeader;
|
|
20
22
|
exports.PageHeaderBreadcrumbBar = PageHeader.PageHeaderBreadcrumbBar;
|
|
21
23
|
exports.PageHeaderContent = PageHeader.PageHeaderContent;
|
|
24
|
+
exports.PageHeaderContentPageActions = PageHeader.PageHeaderContentPageActions;
|
|
25
|
+
exports.PageHeaderContentText = PageHeader.PageHeaderContentText;
|
|
22
26
|
exports.PageHeaderHeroImage = PageHeader.PageHeaderHeroImage;
|
|
23
27
|
exports.PageHeaderTabBar = PageHeader.PageHeaderTabBar;
|
|
24
28
|
exports.PageHeaderTabs = PageHeader.PageHeaderTabs;
|
|
@@ -18,7 +18,7 @@ var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
|
18
18
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
20
|
var useEvent = require('../../internal/useEvent.js');
|
|
21
|
-
var
|
|
21
|
+
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
22
22
|
var react = require('@floating-ui/react');
|
|
23
23
|
var index = require('../FeatureFlags/index.js');
|
|
24
24
|
|
|
@@ -43,19 +43,6 @@ const PopoverContext = /*#__PURE__*/React__default["default"].createContext({
|
|
|
43
43
|
* @deprecated Use NewPopoverAlignment instead.
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
const propMappingFunction = deprecatedValue => {
|
|
47
|
-
const mapping = {
|
|
48
|
-
'top-left': 'top-start',
|
|
49
|
-
'top-right': 'top-end',
|
|
50
|
-
'bottom-left': 'bottom-start',
|
|
51
|
-
'bottom-right': 'bottom-end',
|
|
52
|
-
'left-bottom': 'left-end',
|
|
53
|
-
'left-top': 'left-start',
|
|
54
|
-
'right-bottom': 'right-end',
|
|
55
|
-
'right-top': 'right-start'
|
|
56
|
-
};
|
|
57
|
-
return mapping[deprecatedValue];
|
|
58
|
-
};
|
|
59
46
|
const Popover = /*#__PURE__*/React__default["default"].forwardRef(function PopoverRenderFunction(_ref,
|
|
60
47
|
//this is a workaround, have to come back and fix this.
|
|
61
48
|
forwardRef) {
|
|
@@ -80,7 +67,7 @@ forwardRef) {
|
|
|
80
67
|
const caretRef = React.useRef(null);
|
|
81
68
|
const popover = React.useRef(null);
|
|
82
69
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
83
|
-
let align =
|
|
70
|
+
let align = mapPopoverAlign.mapPopoverAlign(initialAlign);
|
|
84
71
|
|
|
85
72
|
// If the `Popover` is the last focusable item in the tab order, it should also close when the browser window loses focus (#12922)
|
|
86
73
|
useEvent.useWindowEvent('blur', () => {
|
|
@@ -147,7 +134,7 @@ forwardRef) {
|
|
|
147
134
|
alignmentAxis: alignmentAxisOffset,
|
|
148
135
|
mainAxis: popoverDimensions?.current?.offset
|
|
149
136
|
} : 0), autoAlign && react.flip({
|
|
150
|
-
fallbackPlacements: align.includes('bottom') ? ['bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end', 'top', 'top-start', 'top-end'] : ['top', 'top-start', 'top-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end'],
|
|
137
|
+
fallbackPlacements: isTabTip ? align.includes('bottom') ? ['bottom-start', 'bottom-end', 'top-start', 'top-end'] : ['top-start', 'top-end', 'bottom-start', 'bottom-end'] : align.includes('bottom') ? ['bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end', 'top', 'top-start', 'top-end'] : ['top', 'top-start', 'top-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end'],
|
|
151
138
|
fallbackStrategy: 'initialPlacement',
|
|
152
139
|
fallbackAxisSideDirection: 'start',
|
|
153
140
|
boundary: autoAlignBoundary
|
|
@@ -307,11 +294,7 @@ Popover.propTypes = {
|
|
|
307
294
|
// deprecated use right-start instead
|
|
308
295
|
|
|
309
296
|
// new values to match floating-ui
|
|
310
|
-
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
311
|
-
//allowed prop values
|
|
312
|
-
['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
313
|
-
//optional mapper function
|
|
314
|
-
propMappingFunction),
|
|
297
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
|
|
315
298
|
/**
|
|
316
299
|
* Provide a custom element or component to render the top-level node for the
|
|
317
300
|
* component.
|
|
@@ -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, { type
|
|
7
|
+
import React, { type ChangeEvent, type ComponentType, type FunctionComponent, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
|
|
8
8
|
type InputPropsBase = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'>;
|
|
9
9
|
export interface SearchProps extends InputPropsBase {
|
|
10
10
|
/**
|
|
@@ -43,10 +43,7 @@ export interface SearchProps extends InputPropsBase {
|
|
|
43
43
|
/**
|
|
44
44
|
* Optional callback called when the search value changes.
|
|
45
45
|
*/
|
|
46
|
-
onChange
|
|
47
|
-
target: HTMLInputElement;
|
|
48
|
-
type: 'change';
|
|
49
|
-
}): void;
|
|
46
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
50
47
|
/**
|
|
51
48
|
* Optional callback called when the search value is cleared.
|
|
52
49
|
*/
|
|
@@ -23,6 +23,7 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
23
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
24
24
|
require('../FluidForm/FluidForm.js');
|
|
25
25
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
26
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
26
27
|
|
|
27
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
29
|
|
|
@@ -89,14 +90,29 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
|
|
|
89
90
|
if (!value && inputRef.current) {
|
|
90
91
|
inputRef.current.value = '';
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
if (inputRef.current) {
|
|
94
|
+
const inputTarget = Object.assign({}, inputRef.current, {
|
|
95
|
+
value: ''
|
|
96
|
+
});
|
|
97
|
+
const syntheticEvent = {
|
|
98
|
+
bubbles: false,
|
|
99
|
+
cancelable: false,
|
|
100
|
+
currentTarget: inputRef.current,
|
|
101
|
+
defaultPrevented: false,
|
|
102
|
+
eventPhase: 0,
|
|
103
|
+
isDefaultPrevented: () => false,
|
|
104
|
+
isPropagationStopped: () => false,
|
|
105
|
+
isTrusted: false,
|
|
106
|
+
nativeEvent: new Event('change'),
|
|
107
|
+
persist: noopFn.noopFn,
|
|
108
|
+
preventDefault: noopFn.noopFn,
|
|
109
|
+
stopPropagation: noopFn.noopFn,
|
|
110
|
+
target: inputTarget,
|
|
111
|
+
timeStamp: 0,
|
|
112
|
+
type: 'change'
|
|
113
|
+
};
|
|
114
|
+
onChange(syntheticEvent);
|
|
115
|
+
}
|
|
100
116
|
onClear();
|
|
101
117
|
setHasContent(false);
|
|
102
118
|
inputRef.current?.focus();
|
|
@@ -1,10 +1,9 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { StackProps } from './Stack';
|
|
9
|
-
declare const HStack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<
|
|
10
|
-
export { HStack };
|
|
9
|
+
export declare const HStack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -17,15 +17,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
17
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
19
|
|
|
20
|
-
const HStack = /*#__PURE__*/
|
|
21
|
-
let {
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
} = _ref;
|
|
20
|
+
const HStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
21
|
return /*#__PURE__*/React__default["default"].createElement(Stack.Stack, _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
26
22
|
ref: ref,
|
|
27
23
|
orientation: "horizontal"
|
|
28
|
-
})
|
|
24
|
+
}));
|
|
29
25
|
});
|
|
26
|
+
HStack.propTypes = Stack.Stack.propTypes;
|
|
30
27
|
|
|
31
28
|
exports.HStack = HStack;
|
|
@@ -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.
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/**
|
|
9
9
|
* The steps in the spacing scale
|
|
10
|
-
* @type {Array<number>}
|
|
11
10
|
*/
|
|
12
11
|
declare const SPACING_STEPS: number[];
|
|
13
12
|
export interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -54,5 +53,5 @@ export interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
54
53
|
* - https://paste.twilio.design/layout/stack/
|
|
55
54
|
* - https://github.com/Workday/canvas-kit/blob/f2f599654876700f483a1d8c5de82a41315c76f1/modules/labs-react/layout/lib/Stack.tsx
|
|
56
55
|
*/
|
|
57
|
-
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<
|
|
58
|
-
export {
|
|
56
|
+
export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
|
|
57
|
+
export {};
|
|
@@ -24,13 +24,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The steps in the spacing scale
|
|
27
|
-
* @type {Array<number>}
|
|
28
27
|
*/
|
|
29
28
|
const SPACING_STEPS = Array.from({
|
|
30
29
|
length: layout.spacing.length - 1
|
|
31
|
-
}
|
|
32
|
-
return step + 1;
|
|
33
|
-
});
|
|
30
|
+
}, (_, step) => step + 1);
|
|
34
31
|
/**
|
|
35
32
|
* The Stack component is a useful layout utility in a component-based model.
|
|
36
33
|
* This allows components to not use margin and instead delegate the
|
|
@@ -48,7 +45,7 @@ const SPACING_STEPS = Array.from({
|
|
|
48
45
|
* - https://paste.twilio.design/layout/stack/
|
|
49
46
|
* - https://github.com/Workday/canvas-kit/blob/f2f599654876700f483a1d8c5de82a41315c76f1/modules/labs-react/layout/lib/Stack.tsx
|
|
50
47
|
*/
|
|
51
|
-
const Stack = /*#__PURE__*/
|
|
48
|
+
const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
52
49
|
const {
|
|
53
50
|
as: BaseComponent = 'div',
|
|
54
51
|
children,
|
|
@@ -1,10 +1,9 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { StackProps } from './Stack';
|
|
9
|
-
declare const VStack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<
|
|
10
|
-
export { VStack };
|
|
9
|
+
export declare const VStack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -17,11 +17,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
17
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
19
|
|
|
20
|
-
const VStack = /*#__PURE__*/
|
|
20
|
+
const VStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
21
|
return /*#__PURE__*/React__default["default"].createElement(Stack.Stack, _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
22
22
|
ref: ref,
|
|
23
23
|
orientation: "vertical"
|
|
24
24
|
}));
|
|
25
25
|
});
|
|
26
|
+
VStack.propTypes = Stack.Stack.propTypes;
|
|
26
27
|
|
|
27
28
|
exports.VStack = VStack;
|
|
@@ -1,9 +1,9 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export * from './HStack';
|
|
8
|
+
export * from './Stack';
|
|
9
|
+
export * from './VStack';
|
|
@@ -32,10 +32,8 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
32
32
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
33
33
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const TextArea = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
35
|
+
const frFn = React.forwardRef;
|
|
36
|
+
const TextArea = frFn((props, forwardRef) => {
|
|
39
37
|
const {
|
|
40
38
|
className,
|
|
41
39
|
decorator,
|
|
@@ -1,11 +1,11 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { ReactAttr } from '../../types/common';
|
|
9
9
|
type ExcludedAttributes = 'id' | 'value';
|
|
10
10
|
export interface TimePickerProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> {
|
|
11
11
|
/**
|
|
@@ -99,6 +99,5 @@ export interface TimePickerProps extends Omit<ReactAttr<HTMLInputElement>, Exclu
|
|
|
99
99
|
*/
|
|
100
100
|
value?: string;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
declare const TimePicker: TimePickerComponent;
|
|
102
|
+
declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
104
103
|
export default TimePicker;
|
|
@@ -23,8 +23,9 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
23
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const frFn = React.forwardRef;
|
|
27
|
+
const TimePicker = frFn((props, ref) => {
|
|
28
|
+
const {
|
|
28
29
|
children,
|
|
29
30
|
className,
|
|
30
31
|
disabled = false,
|
|
@@ -47,7 +48,7 @@ const TimePicker = /*#__PURE__*/React__default["default"].forwardRef(function Ti
|
|
|
47
48
|
type = 'text',
|
|
48
49
|
value,
|
|
49
50
|
...rest
|
|
50
|
-
} =
|
|
51
|
+
} = props;
|
|
51
52
|
const prefix = usePrefix.usePrefix();
|
|
52
53
|
const [isValue, setValue] = React__default["default"].useState(value);
|
|
53
54
|
const [prevValue, setPrevValue] = React__default["default"].useState(value);
|
|
@@ -1,11 +1,10 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { ForwardRefReturn } from '../../types/common';
|
|
9
8
|
export type TimePickerSelectProps = {
|
|
10
9
|
/**
|
|
11
10
|
* Provide the contents of your TimePickerSelect
|
|
@@ -28,6 +27,26 @@ export type TimePickerSelectProps = {
|
|
|
28
27
|
*/
|
|
29
28
|
id: string;
|
|
30
29
|
} & React.SelectHTMLAttributes<HTMLSelectElement> & React.InputHTMLAttributes<HTMLSelectElement>;
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
declare const TimePickerSelect: React.ForwardRefExoticComponent<{
|
|
31
|
+
/**
|
|
32
|
+
* Provide the contents of your TimePickerSelect
|
|
33
|
+
*/
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Specify an optional className to be applied to the node containing the label and the select box
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optionally provide the default value of the `<select>`
|
|
41
|
+
*/
|
|
42
|
+
defaultValue?: any;
|
|
43
|
+
/**
|
|
44
|
+
* Specify whether the control is disabled
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Specify a custom `id` for the `<select>`
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
} & React.SelectHTMLAttributes<HTMLSelectElement> & React.InputHTMLAttributes<HTMLSelectElement> & React.RefAttributes<HTMLSelectElement>>;
|
|
33
52
|
export default TimePickerSelect;
|
|
@@ -22,15 +22,16 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const frFn = React.forwardRef;
|
|
26
|
+
const TimePickerSelect = frFn((props, ref) => {
|
|
27
|
+
const {
|
|
27
28
|
['aria-label']: ariaLabel = 'open list of options',
|
|
28
29
|
children,
|
|
29
30
|
id,
|
|
30
31
|
disabled = false,
|
|
31
32
|
className,
|
|
32
33
|
...rest
|
|
33
|
-
} =
|
|
34
|
+
} = props;
|
|
34
35
|
const prefix = usePrefix.usePrefix();
|
|
35
36
|
const selectClasses = cx__default["default"]({
|
|
36
37
|
[`${prefix}--select`]: true,
|