@carbon/ibm-products 2.32.0 → 2.33.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +56 -0
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +56 -0
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +56 -0
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionBar/ActionBar.js +8 -1
- package/es/components/CreateTearsheet/CreateTearsheetDivider.d.ts +12 -1
- package/es/components/CreateTearsheet/CreateTearsheetDivider.js +1 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +36 -30
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +49 -2
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.d.ts +3 -1
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +10 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +5 -5
- package/es/components/Datagrid/useRowSize.js +4 -2
- package/es/components/DescriptionList/DescriptionList.d.ts +0 -37
- package/es/components/DescriptionList/DescriptionList.js +7 -12
- package/es/components/DescriptionList/DescriptionListBody.d.ts +2 -0
- package/es/components/DescriptionList/DescriptionListBody.js +39 -0
- package/es/components/DescriptionList/DescriptionListCell.d.ts +2 -0
- package/es/components/DescriptionList/DescriptionListCell.js +39 -0
- package/es/components/DescriptionList/DescriptionListRow.d.ts +2 -0
- package/es/components/DescriptionList/DescriptionListRow.js +41 -0
- package/es/components/DescriptionList/index.d.ts +4 -1
- package/es/components/FilterPanel/FilterPanel.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanel.js +55 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +78 -0
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +63 -0
- package/es/components/FilterPanel/FilterPanelLabel/index.d.ts +1 -0
- package/es/components/FilterPanel/index.d.ts +3 -0
- package/es/components/SidePanel/SidePanel.js +35 -68
- package/es/components/Tearsheet/TearsheetShell.js +9 -1
- package/es/components/Toolbar/ToolbarGroup.d.ts +17 -2
- package/es/components/Toolbar/ToolbarGroup.js +0 -1
- package/es/components/index.d.ts +3 -1
- package/es/global/js/hooks/useFocus.js +9 -2
- package/es/global/js/package-settings.d.ts +7 -0
- package/es/global/js/package-settings.js +7 -0
- package/es/index.js +7 -0
- package/es/settings.d.ts +7 -0
- package/lib/components/ActionBar/ActionBar.js +11 -6
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.d.ts +12 -1
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +1 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +36 -30
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +49 -2
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.d.ts +3 -1
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +9 -2
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +5 -5
- package/lib/components/Datagrid/useRowSize.js +4 -2
- package/lib/components/DescriptionList/DescriptionList.d.ts +0 -37
- package/lib/components/DescriptionList/DescriptionList.js +6 -11
- package/lib/components/DescriptionList/DescriptionListBody.d.ts +2 -0
- package/lib/components/DescriptionList/DescriptionListBody.js +46 -0
- package/lib/components/DescriptionList/DescriptionListCell.d.ts +2 -0
- package/lib/components/DescriptionList/DescriptionListCell.js +46 -0
- package/lib/components/DescriptionList/DescriptionListRow.d.ts +2 -0
- package/lib/components/DescriptionList/DescriptionListRow.js +48 -0
- package/lib/components/DescriptionList/index.d.ts +4 -1
- package/lib/components/FilterPanel/FilterPanel.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanel.js +62 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +85 -0
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +70 -0
- package/lib/components/FilterPanel/FilterPanelLabel/index.d.ts +1 -0
- package/lib/components/FilterPanel/index.d.ts +3 -0
- package/lib/components/SidePanel/SidePanel.js +35 -68
- package/lib/components/Tearsheet/TearsheetShell.js +9 -1
- package/lib/components/Toolbar/ToolbarGroup.d.ts +17 -2
- package/lib/components/Toolbar/ToolbarGroup.js +0 -1
- package/lib/components/index.d.ts +3 -1
- package/lib/global/js/hooks/useFocus.js +9 -2
- package/lib/global/js/package-settings.d.ts +7 -0
- package/lib/global/js/package-settings.js +7 -0
- package/lib/index.js +35 -0
- package/lib/settings.d.ts +7 -0
- package/package.json +3 -3
- package/scss/components/FilterPanel/_carbon-imports.scss +9 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox.scss +32 -0
- package/scss/components/FilterPanel/_filter-panel-label.scss +47 -0
- package/scss/components/FilterPanel/_filter-panel.scss +29 -0
- package/scss/components/FilterPanel/_index-with-carbon.scss +11 -0
- package/scss/components/FilterPanel/_index.scss +10 -0
- package/scss/components/_index-with-carbon.scss +1 -0
- package/scss/components/_index.scss +1 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
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 React = require('react');
|
14
|
+
var index = require('../../../node_modules/prop-types/index.js');
|
15
|
+
var cx = require('classnames');
|
16
|
+
var react = require('@carbon/react');
|
17
|
+
var devtools = require('../../../global/js/utils/devtools.js');
|
18
|
+
var settings = require('../../../settings.js');
|
19
|
+
var FilterPanelLabel = require('../FilterPanelLabel/FilterPanelLabel.js');
|
20
|
+
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
22
|
+
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
24
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
25
|
+
|
26
|
+
var _excluded = ["className", "count", "labelText", "title"];
|
27
|
+
|
28
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
29
|
+
var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-checkbox");
|
30
|
+
var componentName = 'FilterPanelCheckbox';
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Provides a checkbox, label, and count.
|
34
|
+
*/
|
35
|
+
exports.FilterPanelCheckbox = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
36
|
+
var className = _ref.className,
|
37
|
+
count = _ref.count,
|
38
|
+
labelText = _ref.labelText,
|
39
|
+
title = _ref.title,
|
40
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
41
|
+
return /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, rest, {
|
42
|
+
className: cx__default["default"](blockClass, className),
|
43
|
+
labelText: /*#__PURE__*/React__default["default"].createElement(FilterPanelLabel.FilterPanelLabel, {
|
44
|
+
count: count,
|
45
|
+
labelText: labelText,
|
46
|
+
title: title
|
47
|
+
}),
|
48
|
+
ref: ref
|
49
|
+
}, devtools.getDevtoolsProps(componentName)));
|
50
|
+
});
|
51
|
+
|
52
|
+
// Return a placeholder if not released and not enabled by feature flag
|
53
|
+
exports.FilterPanelCheckbox = settings.pkg.checkComponentEnabled(exports.FilterPanelCheckbox, componentName);
|
54
|
+
exports.FilterPanelCheckbox.displayName = componentName;
|
55
|
+
exports.FilterPanelCheckbox.propTypes = {
|
56
|
+
/**
|
57
|
+
* IMPORTANT NOTE
|
58
|
+
*
|
59
|
+
* This component is returning Carbon's Checkbox.
|
60
|
+
*
|
61
|
+
* All of Carbon Checkbox's props are directly available
|
62
|
+
* through "...rest", including id, onClick, etc.
|
63
|
+
*/
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Optional class to be applied to the containing node.
|
67
|
+
*/
|
68
|
+
className: index["default"].string,
|
69
|
+
/**
|
70
|
+
* Number to be displayed with the checkbox.
|
71
|
+
*/
|
72
|
+
count: index["default"].oneOfType([index["default"].number, index["default"].string]),
|
73
|
+
/**
|
74
|
+
* Unique identifier.
|
75
|
+
*/
|
76
|
+
id: index["default"].string.isRequired,
|
77
|
+
/**
|
78
|
+
* Label to be displayed with the checkbox.
|
79
|
+
*/
|
80
|
+
labelText: index["default"].node.isRequired,
|
81
|
+
/**
|
82
|
+
* Optional title attribute for the label.
|
83
|
+
*/
|
84
|
+
title: index["default"].string
|
85
|
+
};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
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 React = require('react');
|
14
|
+
var index = require('../../../node_modules/prop-types/index.js');
|
15
|
+
var cx = require('classnames');
|
16
|
+
var devtools = require('../../../global/js/utils/devtools.js');
|
17
|
+
var settings = require('../../../settings.js');
|
18
|
+
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
20
|
+
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
23
|
+
|
24
|
+
var _excluded = ["className", "count", "labelText", "title"];
|
25
|
+
|
26
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
27
|
+
var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-label");
|
28
|
+
var componentName = 'FilterPanelLabel';
|
29
|
+
|
30
|
+
/**
|
31
|
+
* A container with a label and optional count.
|
32
|
+
*/
|
33
|
+
exports.FilterPanelLabel = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
34
|
+
var className = _ref.className,
|
35
|
+
count = _ref.count,
|
36
|
+
labelText = _ref.labelText,
|
37
|
+
title = _ref.title,
|
38
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
39
|
+
return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
40
|
+
className: cx__default["default"](blockClass, className),
|
41
|
+
ref: ref
|
42
|
+
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement("span", {
|
43
|
+
className: "".concat(blockClass, "__text"),
|
44
|
+
title: title
|
45
|
+
}, labelText), /*#__PURE__*/React__default["default"].createElement("span", {
|
46
|
+
className: "".concat(blockClass, "__count")
|
47
|
+
}, count));
|
48
|
+
});
|
49
|
+
|
50
|
+
// Return a placeholder if not released and not enabled by feature flag
|
51
|
+
exports.FilterPanelLabel = settings.pkg.checkComponentEnabled(exports.FilterPanelLabel, componentName);
|
52
|
+
exports.FilterPanelLabel.displayName = componentName;
|
53
|
+
exports.FilterPanelLabel.propTypes = {
|
54
|
+
/**
|
55
|
+
* Optional class to be applied to the containing node.
|
56
|
+
*/
|
57
|
+
className: index["default"].string,
|
58
|
+
/**
|
59
|
+
* Number to be displayed with the label.
|
60
|
+
*/
|
61
|
+
count: index["default"].oneOfType([index["default"].number, index["default"].string]),
|
62
|
+
/**
|
63
|
+
* The label for the component.
|
64
|
+
*/
|
65
|
+
labelText: index["default"].node.isRequired,
|
66
|
+
/**
|
67
|
+
* Optional title attribute for the label.
|
68
|
+
*/
|
69
|
+
title: index["default"].string
|
70
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { FilterPanelLabel } from "./FilterPanelLabel";
|
@@ -18,7 +18,6 @@ var useResizeObserver = require('../../global/js/hooks/useResizeObserver.js');
|
|
18
18
|
var carbonMotion = require('@carbon/motion');
|
19
19
|
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
var propsHelper = require('../../global/js/utils/props-helper.js');
|
21
|
-
var wrapFocus = require('../../global/js/utils/wrapFocus.js');
|
22
21
|
var settings = require('../../settings.js');
|
23
22
|
var constants = require('./constants.js');
|
24
23
|
var react = require('@carbon/react');
|
@@ -27,6 +26,7 @@ var variants = require('./motion/variants.js');
|
|
27
26
|
var pconsole = require('../../global/js/utils/pconsole.js');
|
28
27
|
var ActionSet = require('../ActionSet/ActionSet.js');
|
29
28
|
var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
|
29
|
+
var useFocus = require('../../global/js/hooks/useFocus.js');
|
30
30
|
|
31
31
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
32
32
|
|
@@ -96,8 +96,6 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
96
96
|
var localRef = React.useRef();
|
97
97
|
var sidePanelRef = ref || localRef;
|
98
98
|
var overlayRef = React.useRef();
|
99
|
-
var startTrapRef = React.useRef();
|
100
|
-
var endTrapRef = React.useRef();
|
101
99
|
var innerContentRef = React.useRef();
|
102
100
|
var closeRef = React.useRef();
|
103
101
|
var animatedScrollRef = React.useRef();
|
@@ -117,6 +115,9 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
117
115
|
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
118
116
|
doAnimateTitle = _useState6[0],
|
119
117
|
setDoAnimateTitle = _useState6[1];
|
118
|
+
var _useFocus = useFocus.useFocus(sidePanelRef),
|
119
|
+
firstElement = _useFocus.firstElement,
|
120
|
+
keyDownListener = _useFocus.keyDownListener;
|
120
121
|
var shouldReduceMotion = framerMotion.useReducedMotion();
|
121
122
|
React.useEffect(function () {
|
122
123
|
setDoAnimateTitle(animateTitle);
|
@@ -144,26 +145,6 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
144
145
|
}
|
145
146
|
}, [currentStep, sidePanelRef, size, previousState === null || previousState === void 0 ? void 0 : previousState.size, id]);
|
146
147
|
|
147
|
-
// set initial focus when side panel opens
|
148
|
-
React.useEffect(function () {
|
149
|
-
var initialFocus = function initialFocus(focusContainerElement) {
|
150
|
-
var containerElement = focusContainerElement;
|
151
|
-
var primaryFocusElement = containerElement && containerElement.querySelector(selectorPrimaryFocus);
|
152
|
-
if (primaryFocusElement) {
|
153
|
-
return primaryFocusElement;
|
154
|
-
} else {
|
155
|
-
return closeRef && closeRef.current;
|
156
|
-
}
|
157
|
-
};
|
158
|
-
var focusButton = function focusButton(focusContainerElement) {
|
159
|
-
var target = initialFocus(focusContainerElement);
|
160
|
-
target === null || target === void 0 || target.focus();
|
161
|
-
};
|
162
|
-
if (open && animationComplete) {
|
163
|
-
focusButton(innerContentRef.current);
|
164
|
-
}
|
165
|
-
}, [selectorPrimaryFocus, open, animationComplete]);
|
166
|
-
|
167
148
|
// Add console warning if labelText is provided without a title.
|
168
149
|
// This combination is not allowed.
|
169
150
|
React.useEffect(function () {
|
@@ -310,23 +291,19 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
310
291
|
}
|
311
292
|
}
|
312
293
|
}, [slideIn, selectorPageContent, placement, size, reducedMotion.matches, open]);
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
endTrapRef: endTrapRef,
|
325
|
-
currentActiveNode: currentActiveNode,
|
326
|
-
oldActiveNode: oldActiveNode
|
327
|
-
});
|
294
|
+
React.useEffect(function () {
|
295
|
+
if (open) {
|
296
|
+
setTimeout(function () {
|
297
|
+
var _document;
|
298
|
+
var primeFocusEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(selectorPrimaryFocus);
|
299
|
+
if (selectorPrimaryFocus && primeFocusEl) {
|
300
|
+
primeFocusEl.focus();
|
301
|
+
} else {
|
302
|
+
firstElement === null || firstElement === void 0 || firstElement.focus();
|
303
|
+
}
|
304
|
+
}, 0);
|
328
305
|
}
|
329
|
-
};
|
306
|
+
}, [animationComplete, firstElement, open, selectorPrimaryFocus]);
|
330
307
|
var primaryActionContainerClassNames = cx__default["default"](["".concat(blockClass, "__actions-container"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__actions-container--condensed"), condensedActions)]);
|
331
308
|
var mainPanelClassNames = cx__default["default"]([blockClass, className, "".concat(blockClass), "".concat(blockClass, "--").concat(size), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--right-placement"), placement === 'right'), "".concat(blockClass, "--left-placement"), placement === 'left'), "".concat(blockClass, "--slide-in"), slideIn), "".concat(blockClass, "--has-slug"), slug), "".concat(blockClass, "--condensed-actions"), condensedActions), "".concat(blockClass, "--animated-title"), doAnimateTitle), "".concat(blockClass, "--has-overlay"), includeOverlay)]);
|
332
309
|
var renderTitle = function renderTitle() {
|
@@ -392,17 +369,17 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
392
369
|
ref: subtitleRef
|
393
370
|
}, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/React__default["default"].createElement("div", {
|
394
371
|
className: "".concat(blockClass, "__action-toolbar")
|
395
|
-
}, actionToolbarButtons.map(function (
|
396
|
-
var label =
|
397
|
-
kind =
|
398
|
-
icon =
|
399
|
-
tooltipPosition =
|
400
|
-
tooltipAlignment =
|
401
|
-
leading =
|
402
|
-
disabled =
|
403
|
-
className =
|
404
|
-
onClick =
|
405
|
-
rest = _rollupPluginBabelHelpers.objectWithoutProperties(
|
372
|
+
}, actionToolbarButtons.map(function (_ref4) {
|
373
|
+
var label = _ref4.label,
|
374
|
+
kind = _ref4.kind,
|
375
|
+
icon = _ref4.icon,
|
376
|
+
tooltipPosition = _ref4.tooltipPosition,
|
377
|
+
tooltipAlignment = _ref4.tooltipAlignment,
|
378
|
+
leading = _ref4.leading,
|
379
|
+
disabled = _ref4.disabled,
|
380
|
+
className = _ref4.className,
|
381
|
+
onClick = _ref4.onClick,
|
382
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref4, _excluded2);
|
406
383
|
return /*#__PURE__*/React__default["default"].createElement(react.Button, _rollupPluginBabelHelpers["extends"]({}, rest, {
|
407
384
|
key: label,
|
408
385
|
kind: kind || 'ghost',
|
@@ -428,7 +405,6 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
428
405
|
return /*#__PURE__*/React__default["default"].createElement(framerMotion.AnimatePresence, null, open && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(framerMotion.motion.div, _rollupPluginBabelHelpers["extends"]({}, devtools.getDevtoolsProps(componentName), rest, {
|
429
406
|
id: id,
|
430
407
|
className: mainPanelClassNames,
|
431
|
-
onBlur: handleBlur,
|
432
408
|
ref: sidePanelRef,
|
433
409
|
role: "complementary",
|
434
410
|
"aria-label": title,
|
@@ -443,13 +419,9 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
443
419
|
custom: {
|
444
420
|
placement: placement,
|
445
421
|
shouldReduceMotion: shouldReduceMotion
|
446
|
-
}
|
447
|
-
|
448
|
-
|
449
|
-
tabIndex: "0",
|
450
|
-
role: "link",
|
451
|
-
className: "".concat(blockClass, "__visually-hidden")
|
452
|
-
}, "Focus sentinel"), doAnimateTitle ? /*#__PURE__*/React__default["default"].createElement("div", {
|
422
|
+
},
|
423
|
+
onKeyDown: keyDownListener
|
424
|
+
}), doAnimateTitle ? /*#__PURE__*/React__default["default"].createElement("div", {
|
453
425
|
ref: animatedScrollRef,
|
454
426
|
className: "".concat(blockClass, "__animated-scroll-wrapper ").concat(blockClass, "--scrolls")
|
455
427
|
}, renderHeader(), renderMain()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, renderHeader(), renderMain()), /*#__PURE__*/React__default["default"].createElement(MotionActionSet, {
|
@@ -458,12 +430,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
458
430
|
size: size === 'xs' ? 'sm' : size,
|
459
431
|
custom: shouldReduceMotion,
|
460
432
|
variants: variants.actionSetVariants
|
461
|
-
}), /*#__PURE__*/React__default["default"].createElement("
|
462
|
-
ref: endTrapRef,
|
463
|
-
tabIndex: "0",
|
464
|
-
role: "link",
|
465
|
-
className: "".concat(blockClass, "__visually-hidden")
|
466
|
-
}, "Focus sentinel")), /*#__PURE__*/React__default["default"].createElement(framerMotion.AnimatePresence, null, includeOverlay && /*#__PURE__*/React__default["default"].createElement(framerMotion.motion.div, {
|
433
|
+
})), /*#__PURE__*/React__default["default"].createElement(framerMotion.AnimatePresence, null, includeOverlay && /*#__PURE__*/React__default["default"].createElement(framerMotion.motion.div, {
|
467
434
|
variants: variants.overlayVariants,
|
468
435
|
initial: "hidden",
|
469
436
|
animate: "visible",
|
@@ -583,8 +550,8 @@ exports.SidePanel.propTypes = {
|
|
583
550
|
* This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
|
584
551
|
* This prop is required when using the `slideIn` variant of the side panel.
|
585
552
|
*/
|
586
|
-
selectorPageContent: index["default"].string.isRequired.if(function (
|
587
|
-
var slideIn =
|
553
|
+
selectorPageContent: index["default"].string.isRequired.if(function (_ref6) {
|
554
|
+
var slideIn = _ref6.slideIn;
|
588
555
|
return slideIn;
|
589
556
|
}),
|
590
557
|
/**
|
@@ -611,8 +578,8 @@ exports.SidePanel.propTypes = {
|
|
611
578
|
/**
|
612
579
|
* Sets the title text
|
613
580
|
*/
|
614
|
-
title: index["default"].string.isRequired.if(function (
|
615
|
-
var labelText =
|
581
|
+
title: index["default"].string.isRequired.if(function (_ref7) {
|
582
|
+
var labelText = _ref7.labelText;
|
616
583
|
return labelText;
|
617
584
|
})
|
618
585
|
};
|
@@ -149,7 +149,15 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
149
149
|
firstElement === null || firstElement === void 0 || firstElement.focus();
|
150
150
|
}, 0);
|
151
151
|
}
|
152
|
-
|
152
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
153
|
+
}, [open]);
|
154
|
+
React.useEffect(function () {
|
155
|
+
if (open && position !== depth) {
|
156
|
+
setTimeout(function () {
|
157
|
+
firstElement === null || firstElement === void 0 || firstElement.focus();
|
158
|
+
}, 0);
|
159
|
+
}
|
160
|
+
}, [position, depth, firstElement, open]);
|
153
161
|
React.useEffect(function () {
|
154
162
|
var notify = function notify() {
|
155
163
|
return stack.all.forEach(function (handler) {
|
@@ -1,3 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2024
|
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
|
+
interface ToolbarGroupProps {
|
9
|
+
/** Provide the content of the `ToolbarGroup` */
|
10
|
+
children?: ReactNode;
|
11
|
+
/** Provide an optional class to be applied to the containing node */
|
12
|
+
className?: string;
|
13
|
+
}
|
1
14
|
/** Toolbar groups organize the commands within a toolbar into related groups. */
|
2
|
-
export let ToolbarGroup: React.ForwardRefExoticComponent<
|
3
|
-
|
15
|
+
export declare let ToolbarGroup: React.ForwardRefExoticComponent<ToolbarGroupProps & {
|
16
|
+
children?: React.ReactNode;
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
export {};
|
@@ -22,7 +22,6 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
23
23
|
|
24
24
|
var _excluded = ["className", "children"];
|
25
|
-
|
26
25
|
/** Toolbar groups organize the commands within a toolbar into related groups. */
|
27
26
|
exports.ToolbarGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
28
27
|
var className = _ref.className,
|
@@ -44,13 +44,13 @@ export { Decorator } from "./Decorator";
|
|
44
44
|
export { DecoratorLink } from "./DecoratorLink";
|
45
45
|
export { DecoratorSingleButton } from "./DecoratorSingleButton";
|
46
46
|
export { DecoratorDualButton } from "./DecoratorDualButton";
|
47
|
-
export { DescriptionList } from "./DescriptionList";
|
48
47
|
export { FullPageError } from "./FullPageError";
|
49
48
|
export { SearchBar } from "./SearchBar";
|
50
49
|
export { Nav } from "./Nav";
|
51
50
|
export { StringFormatter } from "./StringFormatter";
|
52
51
|
export { UserAvatar } from "./UserAvatar";
|
53
52
|
export { StatusIndicator } from "./StatusIndicator";
|
53
|
+
export { ActionBar } from "./ActionBar";
|
54
54
|
export { ComboButton, ComboButtonItem } from "./ComboButton";
|
55
55
|
export { CreateFullPage, CreateFullPageStep } from "./CreateFullPage";
|
56
56
|
export { CreateTearsheet, CreateTearsheetStep, CreateTearsheetDivider } from "./CreateTearsheet";
|
@@ -63,3 +63,5 @@ export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows,
|
|
63
63
|
export { EditTearsheet, EditTearsheetForm } from "./EditTearsheet";
|
64
64
|
export { Guidebanner, GuidebannerElement, GuidebannerElementButton, GuidebannerElementLink } from "./Guidebanner";
|
65
65
|
export { InlineTip, InlineTipButton, InlineTipLink } from "./InlineTip";
|
66
|
+
export { DescriptionList, DescriptionListBody, DescriptionListCell, DescriptionListRow } from "./DescriptionList";
|
67
|
+
export { FilterPanel, FilterPanelCheckbox, FilterPanelLabel } from "./FilterPanel";
|
@@ -31,10 +31,17 @@ var useFocus = function useFocus(modalRef) {
|
|
31
31
|
var query = "".concat(queryButton, ",").concat(queryLink, ",").concat(queryInput, ",").concat(querySelect, ",").concat(queryTextarea, ", ").concat(queryTabIndex);
|
32
32
|
var modalEl = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current;
|
33
33
|
var getFocusable = React.useCallback(function () {
|
34
|
+
var _focusableElements, _focusableElements2, _focusableElements3, _focusableElements4;
|
34
35
|
// Selecting all focusable elements based on the above conditions
|
35
36
|
var focusableElements = modalEl === null || modalEl === void 0 ? void 0 : modalEl.querySelectorAll("".concat(query));
|
36
|
-
|
37
|
-
|
37
|
+
if ((_focusableElements = focusableElements) !== null && _focusableElements !== void 0 && _focusableElements.length) {
|
38
|
+
focusableElements = Array.prototype.filter.call(focusableElements, function (el) {
|
39
|
+
var _window;
|
40
|
+
return ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(el)) === null || _window === void 0 ? void 0 : _window.display) !== 'none';
|
41
|
+
});
|
42
|
+
}
|
43
|
+
var first = (_focusableElements2 = focusableElements) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2[0];
|
44
|
+
var last = (_focusableElements3 = focusableElements) === null || _focusableElements3 === void 0 ? void 0 : _focusableElements3[((_focusableElements4 = focusableElements) === null || _focusableElements4 === void 0 ? void 0 : _focusableElements4.length) - 1];
|
38
45
|
var all = focusableElements;
|
39
46
|
return {
|
40
47
|
first: first,
|
@@ -83,6 +83,10 @@ declare namespace defaults {
|
|
83
83
|
let StringFormatter: boolean;
|
84
84
|
let StatusIndicator: boolean;
|
85
85
|
let StatusIndicatorStep: boolean;
|
86
|
+
let ActionBar: boolean;
|
87
|
+
let FilterPanel: boolean;
|
88
|
+
let FilterPanelCheckbox: boolean;
|
89
|
+
let FilterPanelLabel: boolean;
|
86
90
|
let Coachmark: boolean;
|
87
91
|
let CoachmarkBeacon: boolean;
|
88
92
|
let CoachmarkButton: boolean;
|
@@ -95,6 +99,9 @@ declare namespace defaults {
|
|
95
99
|
let DecoratorSingleButton: boolean;
|
96
100
|
let DecoratorDualButton: boolean;
|
97
101
|
let DescriptionList: boolean;
|
102
|
+
let DescriptionListBody: boolean;
|
103
|
+
let DescriptionListCell: boolean;
|
104
|
+
let DescriptionListRow: boolean;
|
98
105
|
let SearchBar: boolean;
|
99
106
|
let UserAvatar: boolean;
|
100
107
|
let Checklist: boolean;
|
@@ -86,6 +86,10 @@ var defaults = {
|
|
86
86
|
StringFormatter: false,
|
87
87
|
StatusIndicator: false,
|
88
88
|
StatusIndicatorStep: false,
|
89
|
+
ActionBar: false,
|
90
|
+
FilterPanel: false,
|
91
|
+
FilterPanelCheckbox: false,
|
92
|
+
FilterPanelLabel: false,
|
89
93
|
/* new component flags here - comment used by generate CLI */
|
90
94
|
|
91
95
|
// Novice to pro components not yet reviewed and released:
|
@@ -101,6 +105,9 @@ var defaults = {
|
|
101
105
|
DecoratorSingleButton: false,
|
102
106
|
DecoratorDualButton: false,
|
103
107
|
DescriptionList: false,
|
108
|
+
DescriptionListBody: false,
|
109
|
+
DescriptionListCell: false,
|
110
|
+
DescriptionListRow: false,
|
104
111
|
SearchBar: false,
|
105
112
|
UserAvatar: false,
|
106
113
|
/* new component flags here - comment used by generate CLI */
|
package/lib/index.js
CHANGED
@@ -114,12 +114,19 @@ var DecoratorLink = require('./components/DecoratorLink/DecoratorLink.js');
|
|
114
114
|
var DecoratorSingleButton = require('./components/DecoratorSingleButton/DecoratorSingleButton.js');
|
115
115
|
var DecoratorDualButton = require('./components/DecoratorDualButton/DecoratorDualButton.js');
|
116
116
|
var DescriptionList = require('./components/DescriptionList/DescriptionList.js');
|
117
|
+
var DescriptionListBody = require('./components/DescriptionList/DescriptionListBody.js');
|
118
|
+
var DescriptionListCell = require('./components/DescriptionList/DescriptionListCell.js');
|
119
|
+
var DescriptionListRow = require('./components/DescriptionList/DescriptionListRow.js');
|
117
120
|
var FullPageError = require('./components/FullPageError/FullPageError.js');
|
118
121
|
var SearchBar = require('./components/SearchBar/SearchBar.js');
|
119
122
|
var Nav = require('./components/Nav/Nav.js');
|
120
123
|
var StringFormatter = require('./components/StringFormatter/StringFormatter.js');
|
121
124
|
var UserAvatar = require('./components/UserAvatar/UserAvatar.js');
|
122
125
|
var StatusIndicator = require('./components/StatusIndicator/StatusIndicator.js');
|
126
|
+
var ActionBar = require('./components/ActionBar/ActionBar.js');
|
127
|
+
var FilterPanel = require('./components/FilterPanel/FilterPanel.js');
|
128
|
+
var FilterPanelCheckbox = require('./components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js');
|
129
|
+
var FilterPanelLabel = require('./components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js');
|
123
130
|
|
124
131
|
|
125
132
|
|
@@ -475,6 +482,18 @@ Object.defineProperty(exports, 'DescriptionList', {
|
|
475
482
|
enumerable: true,
|
476
483
|
get: function () { return DescriptionList.DescriptionList; }
|
477
484
|
});
|
485
|
+
Object.defineProperty(exports, 'DescriptionListBody', {
|
486
|
+
enumerable: true,
|
487
|
+
get: function () { return DescriptionListBody.DescriptionListBody; }
|
488
|
+
});
|
489
|
+
Object.defineProperty(exports, 'DescriptionListCell', {
|
490
|
+
enumerable: true,
|
491
|
+
get: function () { return DescriptionListCell.DescriptionListCell; }
|
492
|
+
});
|
493
|
+
Object.defineProperty(exports, 'DescriptionListRow', {
|
494
|
+
enumerable: true,
|
495
|
+
get: function () { return DescriptionListRow.DescriptionListRow; }
|
496
|
+
});
|
478
497
|
Object.defineProperty(exports, 'FullPageError', {
|
479
498
|
enumerable: true,
|
480
499
|
get: function () { return FullPageError.FullPageError; }
|
@@ -499,3 +518,19 @@ Object.defineProperty(exports, 'StatusIndicator', {
|
|
499
518
|
enumerable: true,
|
500
519
|
get: function () { return StatusIndicator.StatusIndicator; }
|
501
520
|
});
|
521
|
+
Object.defineProperty(exports, 'ActionBar', {
|
522
|
+
enumerable: true,
|
523
|
+
get: function () { return ActionBar.ActionBar; }
|
524
|
+
});
|
525
|
+
Object.defineProperty(exports, 'FilterPanel', {
|
526
|
+
enumerable: true,
|
527
|
+
get: function () { return FilterPanel.FilterPanel; }
|
528
|
+
});
|
529
|
+
Object.defineProperty(exports, 'FilterPanelCheckbox', {
|
530
|
+
enumerable: true,
|
531
|
+
get: function () { return FilterPanelCheckbox.FilterPanelCheckbox; }
|
532
|
+
});
|
533
|
+
Object.defineProperty(exports, 'FilterPanelLabel', {
|
534
|
+
enumerable: true,
|
535
|
+
get: function () { return FilterPanelLabel.FilterPanelLabel; }
|
536
|
+
});
|
package/lib/settings.d.ts
CHANGED
@@ -69,6 +69,10 @@ export const pkg: {
|
|
69
69
|
StringFormatter: boolean;
|
70
70
|
StatusIndicator: boolean;
|
71
71
|
StatusIndicatorStep: boolean;
|
72
|
+
ActionBar: boolean;
|
73
|
+
FilterPanel: boolean;
|
74
|
+
FilterPanelCheckbox: boolean;
|
75
|
+
FilterPanelLabel: boolean;
|
72
76
|
Coachmark: boolean;
|
73
77
|
CoachmarkBeacon: boolean;
|
74
78
|
CoachmarkButton: boolean;
|
@@ -81,6 +85,9 @@ export const pkg: {
|
|
81
85
|
DecoratorSingleButton: boolean;
|
82
86
|
DecoratorDualButton: boolean;
|
83
87
|
DescriptionList: boolean;
|
88
|
+
DescriptionListBody: boolean;
|
89
|
+
DescriptionListCell: boolean;
|
90
|
+
DescriptionListRow: boolean;
|
84
91
|
SearchBar: boolean;
|
85
92
|
UserAvatar: boolean;
|
86
93
|
Checklist: boolean;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.33.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -90,7 +90,7 @@
|
|
90
90
|
},
|
91
91
|
"dependencies": {
|
92
92
|
"@babel/runtime": "^7.23.9",
|
93
|
-
"@carbon/ibm-products-styles": "^2.
|
93
|
+
"@carbon/ibm-products-styles": "^2.31.0",
|
94
94
|
"@carbon/telemetry": "^0.1.0",
|
95
95
|
"@dnd-kit/core": "^6.0.8",
|
96
96
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -114,5 +114,5 @@
|
|
114
114
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
115
115
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
116
116
|
},
|
117
|
-
"gitHead": "
|
117
|
+
"gitHead": "389407c790f9238df195d0c53a384d7a06075f06"
|
118
118
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2024, 2024
|
3
|
+
//
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
6
|
+
//
|
7
|
+
|
8
|
+
// Import any Carbon component styles used from FilterPanel in this file.
|
9
|
+
// FilterPanel uses the following Carbon components:
|
@@ -0,0 +1,32 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2024, 2024
|
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
|
+
/* stylelint-disable max-nesting-depth */
|
9
|
+
|
10
|
+
// Standard imports.
|
11
|
+
@use '../../global/styles/project-settings' as c4p-settings;
|
12
|
+
@use '../../global/styles/mixins';
|
13
|
+
|
14
|
+
@use '@carbon/styles/scss/type';
|
15
|
+
|
16
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
17
|
+
$block-class: #{c4p-settings.$pkg-prefix}--filter-panel-checkbox;
|
18
|
+
$label: #{c4p-settings.$pkg-prefix}--filter-panel-label;
|
19
|
+
|
20
|
+
// Set Carbon's Checkbox label to 100% the width of its container.
|
21
|
+
.#{$block-class} .#{c4p-settings.$carbon-prefix}--checkbox-label,
|
22
|
+
.#{$block-class} .#{c4p-settings.$carbon-prefix}--checkbox-label-text {
|
23
|
+
width: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
.#{$block-class} .#{$label}__text {
|
27
|
+
@include type.type-style('body-compact-01');
|
28
|
+
}
|
29
|
+
|
30
|
+
.#{$block-class} .#{$label}__count {
|
31
|
+
@include type.type-style('label-01');
|
32
|
+
}
|