@carbon/ibm-products 2.54.0-canary.36 → 2.54.0-canary.37
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/css/index-full-carbon.css +2 -2
- 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-released-only.css +2 -2
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +2 -2
- 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 +2 -2
- 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/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +18 -9
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +17 -8
- package/package.json +3 -3
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +2 -3
@@ -10,7 +10,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { useResizeObserver } from '../../global/js/hooks/useResizeObserver.js';
|
13
|
-
import { usePrefix, Breadcrumb, BreadcrumbItem, OverflowMenu, Link, Tooltip,
|
13
|
+
import { usePrefix, Breadcrumb, BreadcrumbItem, OverflowMenu, Link, Tooltip, unstable_FeatureFlags, MenuItem } from '@carbon/react';
|
14
14
|
import { pkg } from '../../settings.js';
|
15
15
|
import { OverflowMenuHorizontal, ArrowLeft } from '@carbon/react/icons';
|
16
16
|
import uuidv4 from '../../global/js/utils/uuidv4.js';
|
@@ -61,12 +61,20 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
61
61
|
// eslint-disable-next-line react/prop-types
|
62
62
|
var BreadcrumbOverflowMenu = function BreadcrumbOverflowMenu(_ref2) {
|
63
63
|
var overflowItems = _ref2.overflowItems;
|
64
|
+
var handleClick = function handleClick(evt, item) {
|
65
|
+
var _item$props, _item$props2, _item$props2$onClick;
|
66
|
+
if (item !== null && item !== void 0 && (_item$props = item.props) !== null && _item$props !== void 0 && _item$props.href) {
|
67
|
+
window.location.href = item.props.href;
|
68
|
+
}
|
69
|
+
item === null || item === void 0 || (_item$props2 = item.props) === null || _item$props2 === void 0 || (_item$props2$onClick = _item$props2.onClick) === null || _item$props2$onClick === void 0 || _item$props2$onClick.call(_item$props2, evt);
|
70
|
+
};
|
64
71
|
return /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
|
65
72
|
key: "breadcrumb-overflow-".concat(internalId.current)
|
73
|
+
}, /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
|
74
|
+
enableV12Overflowmenu: true
|
66
75
|
}, /*#__PURE__*/React__default.createElement(OverflowMenu, {
|
67
|
-
align: overflowTooltipAlign,
|
68
76
|
"aria-label": overflowAriaLabel,
|
69
|
-
|
77
|
+
label: overflowAriaLabel // also needs setting to avoid a11y "Accessible name does not match or contain the visible label text"
|
70
78
|
,
|
71
79
|
renderIcon: function renderIcon(props) {
|
72
80
|
return /*#__PURE__*/React__default.createElement(OverflowMenuHorizontal, _extends({
|
@@ -74,17 +82,18 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
74
82
|
}, props));
|
75
83
|
},
|
76
84
|
className: "".concat(blockClass, "__overflow-menu"),
|
77
|
-
|
85
|
+
tooltipAlignment: overflowTooltipAlign
|
78
86
|
},
|
79
87
|
// eslint-disable-next-line react/prop-types
|
80
88
|
overflowItems.map(function (item, index) {
|
81
|
-
return /*#__PURE__*/React__default.createElement(
|
89
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
82
90
|
key: "breadcrumb-overflow-menu-item-".concat(internalId.current, "-").concat(index),
|
83
|
-
|
84
|
-
|
85
|
-
|
91
|
+
onClick: function onClick(evt) {
|
92
|
+
return handleClick(evt, item);
|
93
|
+
},
|
94
|
+
label: item.props.children
|
86
95
|
});
|
87
|
-
})));
|
96
|
+
}))));
|
88
97
|
};
|
89
98
|
|
90
99
|
// create hidden sizing items
|
@@ -63,12 +63,20 @@ exports.BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
63
63
|
// eslint-disable-next-line react/prop-types
|
64
64
|
var BreadcrumbOverflowMenu = function BreadcrumbOverflowMenu(_ref2) {
|
65
65
|
var overflowItems = _ref2.overflowItems;
|
66
|
+
var handleClick = function handleClick(evt, item) {
|
67
|
+
var _item$props, _item$props2, _item$props2$onClick;
|
68
|
+
if (item !== null && item !== void 0 && (_item$props = item.props) !== null && _item$props !== void 0 && _item$props.href) {
|
69
|
+
window.location.href = item.props.href;
|
70
|
+
}
|
71
|
+
item === null || item === void 0 || (_item$props2 = item.props) === null || _item$props2 === void 0 || (_item$props2$onClick = _item$props2.onClick) === null || _item$props2$onClick === void 0 || _item$props2$onClick.call(_item$props2, evt);
|
72
|
+
};
|
66
73
|
return /*#__PURE__*/React.createElement(react.BreadcrumbItem, {
|
67
74
|
key: "breadcrumb-overflow-".concat(internalId.current)
|
75
|
+
}, /*#__PURE__*/React.createElement(react.unstable_FeatureFlags, {
|
76
|
+
enableV12Overflowmenu: true
|
68
77
|
}, /*#__PURE__*/React.createElement(react.OverflowMenu, {
|
69
|
-
align: overflowTooltipAlign,
|
70
78
|
"aria-label": overflowAriaLabel,
|
71
|
-
|
79
|
+
label: overflowAriaLabel // also needs setting to avoid a11y "Accessible name does not match or contain the visible label text"
|
72
80
|
,
|
73
81
|
renderIcon: function renderIcon(props) {
|
74
82
|
return /*#__PURE__*/React.createElement(icons.OverflowMenuHorizontal, _rollupPluginBabelHelpers.extends({
|
@@ -76,17 +84,18 @@ exports.BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
76
84
|
}, props));
|
77
85
|
},
|
78
86
|
className: "".concat(blockClass, "__overflow-menu"),
|
79
|
-
|
87
|
+
tooltipAlignment: overflowTooltipAlign
|
80
88
|
},
|
81
89
|
// eslint-disable-next-line react/prop-types
|
82
90
|
overflowItems.map(function (item, index) {
|
83
|
-
return /*#__PURE__*/React.createElement(react.
|
91
|
+
return /*#__PURE__*/React.createElement(react.MenuItem, {
|
84
92
|
key: "breadcrumb-overflow-menu-item-".concat(internalId.current, "-").concat(index),
|
85
|
-
|
86
|
-
|
87
|
-
|
93
|
+
onClick: function onClick(evt) {
|
94
|
+
return handleClick(evt, item);
|
95
|
+
},
|
96
|
+
label: item.props.children
|
88
97
|
});
|
89
|
-
})));
|
98
|
+
}))));
|
90
99
|
};
|
91
100
|
|
92
101
|
// create hidden sizing items
|
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.54.0-canary.
|
4
|
+
"version": "2.54.0-canary.37+f716852c9",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.24.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.50.0-canary.37+f716852c9",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "f716852c979a0b9556e853fad7e7a7774b4c6579"
|
124
124
|
}
|
@@ -89,7 +89,6 @@ $_block-class: #{c4p-settings.$pkg-prefix}--breadcrumb-with-overflow;
|
|
89
89
|
text-overflow: ellipsis;
|
90
90
|
}
|
91
91
|
}
|
92
|
-
|
93
|
-
|
94
|
-
z-index: utilities.z('header');
|
92
|
+
.#{$_block-class}__overflow-menu {
|
93
|
+
line-height: 0;
|
95
94
|
}
|