@carbon/react 1.42.0-rc.0 → 1.42.1
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 +2044 -1863
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +72 -9
- package/es/components/Notification/Notification.js +48 -6
- package/es/components/UIShell/SideNavItems.d.ts +25 -0
- package/es/components/UIShell/SideNavItems.js +3 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +72 -9
- package/lib/components/Notification/Notification.js +48 -6
- package/lib/components/UIShell/SideNavItems.d.ts +25 -0
- package/lib/components/UIShell/SideNavItems.js +3 -3
- package/package.json +5 -5
|
@@ -44,22 +44,39 @@ FluidMultiSelect.propTypes = {
|
|
|
44
44
|
*/
|
|
45
45
|
className: PropTypes.string,
|
|
46
46
|
/**
|
|
47
|
-
* Specify the
|
|
47
|
+
* Specify the text that should be read for screen readers that describes total items selected
|
|
48
|
+
*/
|
|
49
|
+
clearSelectionDescription: PropTypes.string,
|
|
50
|
+
/**
|
|
51
|
+
* Specify the text that should be read for screen readers to clear selection.
|
|
52
|
+
*/
|
|
53
|
+
clearSelectionText: PropTypes.string,
|
|
54
|
+
/**
|
|
55
|
+
* Provide a compare function that is used to determine the ordering of
|
|
56
|
+
* options. See 'sortItems' for more control.
|
|
57
|
+
*/
|
|
58
|
+
compareItems: PropTypes.func,
|
|
59
|
+
/**
|
|
60
|
+
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
48
61
|
*/
|
|
49
62
|
direction: PropTypes.oneOf(['top', 'bottom']),
|
|
50
63
|
/**
|
|
51
64
|
* Specify whether the `<input>` should be disabled
|
|
52
65
|
*/
|
|
53
66
|
disabled: PropTypes.bool,
|
|
67
|
+
/**
|
|
68
|
+
* Additional props passed to Downshift
|
|
69
|
+
*/
|
|
70
|
+
downshiftProps: PropTypes.object,
|
|
54
71
|
/**
|
|
55
72
|
* Specify a custom `id` for the `<input>`
|
|
56
73
|
*/
|
|
57
74
|
id: PropTypes.string.isRequired,
|
|
58
75
|
/**
|
|
59
|
-
* Allow users to pass in
|
|
60
|
-
*
|
|
76
|
+
* Allow users to pass in arbitrary items from their collection that are
|
|
77
|
+
* pre-selected
|
|
61
78
|
*/
|
|
62
|
-
|
|
79
|
+
initialSelectedItems: PropTypes.array,
|
|
63
80
|
/**
|
|
64
81
|
* Specify if the currently selected value is invalid.
|
|
65
82
|
*/
|
|
@@ -97,20 +114,62 @@ FluidMultiSelect.propTypes = {
|
|
|
97
114
|
* this field is for
|
|
98
115
|
*/
|
|
99
116
|
label: PropTypes.node.isRequired,
|
|
117
|
+
/**
|
|
118
|
+
* Specify the locale of the control. Used for the default `compareItems`
|
|
119
|
+
* used for sorting the list of items in the control.
|
|
120
|
+
*/
|
|
121
|
+
locale: PropTypes.string,
|
|
100
122
|
/**
|
|
101
123
|
* `onChange` is a utility for this controlled component to communicate to a
|
|
102
124
|
* consuming component what kind of internal state changes are occurring.
|
|
103
125
|
*/
|
|
104
126
|
onChange: PropTypes.func,
|
|
105
127
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
128
|
+
* **Filterable variant only** - `onInputValueChange` is a utility for this controlled component to communicate to
|
|
129
|
+
* the currently typed input.
|
|
108
130
|
*/
|
|
109
|
-
|
|
131
|
+
onInputValueChange: PropTypes.func,
|
|
110
132
|
/**
|
|
111
|
-
*
|
|
133
|
+
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
134
|
+
* consuming component that the menu was open(`true`)/closed(`false`).
|
|
112
135
|
*/
|
|
113
|
-
|
|
136
|
+
onMenuChange: PropTypes.func,
|
|
137
|
+
/**
|
|
138
|
+
* Whether or not the Multiselect is readonly
|
|
139
|
+
*/
|
|
140
|
+
readOnly: PropTypes.bool,
|
|
141
|
+
/**
|
|
142
|
+
* For full control of the selected items
|
|
143
|
+
*/
|
|
144
|
+
selectedItems: PropTypes.array,
|
|
145
|
+
/**
|
|
146
|
+
* Specify feedback (mode) of the selection.
|
|
147
|
+
* `top`: selected item jumps to top
|
|
148
|
+
* `fixed`: selected item stays at it's position
|
|
149
|
+
* `top-after-reopen`: selected item jump to top after reopen dropdown
|
|
150
|
+
*/
|
|
151
|
+
selectionFeedback: PropTypes.oneOf(['top', 'fixed', 'top-after-reopen']),
|
|
152
|
+
/**
|
|
153
|
+
* Provide a method that sorts all options in the control. Overriding this
|
|
154
|
+
* prop means that you also have to handle the sort logic for selected versus
|
|
155
|
+
* un-selected items. If you just want to control ordering, consider the
|
|
156
|
+
* `compareItems` prop instead.
|
|
157
|
+
*
|
|
158
|
+
* The return value should be a number whose sign indicates the relative order
|
|
159
|
+
* of the two elements: negative if a is less than b, positive if a is greater
|
|
160
|
+
* than b, and zero if they are equal.
|
|
161
|
+
*
|
|
162
|
+
* sortItems :
|
|
163
|
+
* (items: Array<Item>, {
|
|
164
|
+
* selectedItems: Array<Item>,
|
|
165
|
+
* itemToString: Item => string,
|
|
166
|
+
* compareItems: (itemA: string, itemB: string, {
|
|
167
|
+
* locale: string
|
|
168
|
+
* }) => number,
|
|
169
|
+
* locale: string,
|
|
170
|
+
* }) => Array<Item>
|
|
171
|
+
*/
|
|
172
|
+
sortItems: PropTypes.func,
|
|
114
173
|
/**
|
|
115
174
|
* Provide the title text that will be read by a screen reader when
|
|
116
175
|
* visiting this control
|
|
@@ -120,6 +179,10 @@ FluidMultiSelect.propTypes = {
|
|
|
120
179
|
* Callback function for translating ListBoxMenuIcon SVG title
|
|
121
180
|
*/
|
|
122
181
|
translateWithId: PropTypes.func,
|
|
182
|
+
/**
|
|
183
|
+
* Specify title to show title on hover
|
|
184
|
+
*/
|
|
185
|
+
useTitleInItem: PropTypes.bool,
|
|
123
186
|
/**
|
|
124
187
|
* Specify whether the control is currently in warning state
|
|
125
188
|
*/
|
|
@@ -19,6 +19,7 @@ import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildre
|
|
|
19
19
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
20
20
|
import { useId } from '../../internal/useId.js';
|
|
21
21
|
import { noopFn } from '../../internal/noopFn.js';
|
|
22
|
+
import wrapFocus from '../../internal/wrapFocus.js';
|
|
22
23
|
import { Text } from '../Text/Text.js';
|
|
23
24
|
import { matches } from '../../internal/keyboard/match.js';
|
|
24
25
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
@@ -506,12 +507,40 @@ function ActionableNotification(_ref6) {
|
|
|
506
507
|
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
507
508
|
[`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
|
|
508
509
|
});
|
|
510
|
+
const innerModal = useRef(null);
|
|
511
|
+
const startTrap = useRef(null);
|
|
512
|
+
const endTrap = useRef(null);
|
|
509
513
|
const ref = useRef(null);
|
|
510
514
|
useIsomorphicEffect(() => {
|
|
511
|
-
if (
|
|
512
|
-
|
|
515
|
+
if (hasFocus) {
|
|
516
|
+
const button = document.querySelector('button.cds--actionable-notification__action-button');
|
|
517
|
+
button?.focus();
|
|
513
518
|
}
|
|
514
519
|
});
|
|
520
|
+
function handleBlur(_ref7) {
|
|
521
|
+
let {
|
|
522
|
+
target: oldActiveNode,
|
|
523
|
+
relatedTarget: currentActiveNode
|
|
524
|
+
} = _ref7;
|
|
525
|
+
if (isOpen && currentActiveNode && oldActiveNode) {
|
|
526
|
+
const {
|
|
527
|
+
current: bodyNode
|
|
528
|
+
} = innerModal;
|
|
529
|
+
const {
|
|
530
|
+
current: startTrapNode
|
|
531
|
+
} = startTrap;
|
|
532
|
+
const {
|
|
533
|
+
current: endTrapNode
|
|
534
|
+
} = endTrap;
|
|
535
|
+
wrapFocus({
|
|
536
|
+
bodyNode,
|
|
537
|
+
startTrapNode,
|
|
538
|
+
endTrapNode,
|
|
539
|
+
currentActiveNode,
|
|
540
|
+
oldActiveNode
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
}
|
|
515
544
|
const handleClose = evt => {
|
|
516
545
|
if (!onClose || onClose(evt) !== false) {
|
|
517
546
|
setIsOpen(false);
|
|
@@ -529,8 +558,14 @@ function ActionableNotification(_ref6) {
|
|
|
529
558
|
ref: ref,
|
|
530
559
|
role: role,
|
|
531
560
|
className: containerClassName,
|
|
532
|
-
"aria-labelledby": title ? id : subtitleId
|
|
533
|
-
|
|
561
|
+
"aria-labelledby": title ? id : subtitleId,
|
|
562
|
+
onBlur: handleBlur
|
|
563
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
564
|
+
ref: startTrap,
|
|
565
|
+
tabIndex: 0,
|
|
566
|
+
role: "link",
|
|
567
|
+
className: `${prefix}--visually-hidden`
|
|
568
|
+
}, "Focus sentinel"), /*#__PURE__*/React__default.createElement("div", {
|
|
534
569
|
className: `${prefix}--actionable-notification__details`
|
|
535
570
|
}, /*#__PURE__*/React__default.createElement(NotificationIcon, {
|
|
536
571
|
notificationType: inline ? 'inline' : 'toast',
|
|
@@ -548,14 +583,21 @@ function ActionableNotification(_ref6) {
|
|
|
548
583
|
as: "div",
|
|
549
584
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
550
585
|
id: subtitleId
|
|
551
|
-
}, subtitle), children))),
|
|
586
|
+
}, subtitle), children))), /*#__PURE__*/React__default.createElement("div", {
|
|
587
|
+
ref: innerModal
|
|
588
|
+
}, actionButtonLabel && /*#__PURE__*/React__default.createElement(NotificationActionButton, {
|
|
552
589
|
onClick: onActionButtonClick,
|
|
553
590
|
inline: inline
|
|
554
591
|
}, actionButtonLabel), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
|
|
555
592
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
556
593
|
notificationType: "actionable",
|
|
557
594
|
onClick: handleCloseButtonClick
|
|
558
|
-
}))
|
|
595
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
596
|
+
ref: endTrap,
|
|
597
|
+
tabIndex: 0,
|
|
598
|
+
role: "link",
|
|
599
|
+
className: `${prefix}--visually-hidden`
|
|
600
|
+
}, "Focus sentinel"));
|
|
559
601
|
}
|
|
560
602
|
ActionableNotification.propTypes = {
|
|
561
603
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
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 from 'react';
|
|
8
|
+
interface SideNavItemsProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
11
|
+
* container
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provide an optional class to be applied to the containing node
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Property to indicate if the side nav container is open (or not). Use to
|
|
20
|
+
* keep local state and styling in step with the SideNav expansion state.
|
|
21
|
+
*/
|
|
22
|
+
isSideNavExpanded?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const SideNavItems: React.FC<SideNavItemsProps>;
|
|
25
|
+
export default SideNavItems;
|
|
@@ -22,8 +22,9 @@ const SideNavItems = _ref => {
|
|
|
22
22
|
const childrenWithExpandedState = React__default.Children.map(children, child => {
|
|
23
23
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
24
24
|
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
|
|
25
|
+
const childDisplayName = child.type?.displayName;
|
|
25
26
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
26
|
-
...(CARBON_SIDENAV_ITEMS.includes(
|
|
27
|
+
...(CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
27
28
|
isSideNavExpanded
|
|
28
29
|
} : {})
|
|
29
30
|
});
|
|
@@ -50,6 +51,5 @@ SideNavItems.propTypes = {
|
|
|
50
51
|
*/
|
|
51
52
|
isSideNavExpanded: PropTypes.bool
|
|
52
53
|
};
|
|
53
|
-
var SideNavItems$1 = SideNavItems;
|
|
54
54
|
|
|
55
|
-
export { SideNavItems
|
|
55
|
+
export { SideNavItems as default };
|
|
@@ -54,22 +54,39 @@ FluidMultiSelect.propTypes = {
|
|
|
54
54
|
*/
|
|
55
55
|
className: PropTypes__default["default"].string,
|
|
56
56
|
/**
|
|
57
|
-
* Specify the
|
|
57
|
+
* Specify the text that should be read for screen readers that describes total items selected
|
|
58
|
+
*/
|
|
59
|
+
clearSelectionDescription: PropTypes__default["default"].string,
|
|
60
|
+
/**
|
|
61
|
+
* Specify the text that should be read for screen readers to clear selection.
|
|
62
|
+
*/
|
|
63
|
+
clearSelectionText: PropTypes__default["default"].string,
|
|
64
|
+
/**
|
|
65
|
+
* Provide a compare function that is used to determine the ordering of
|
|
66
|
+
* options. See 'sortItems' for more control.
|
|
67
|
+
*/
|
|
68
|
+
compareItems: PropTypes__default["default"].func,
|
|
69
|
+
/**
|
|
70
|
+
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
58
71
|
*/
|
|
59
72
|
direction: PropTypes__default["default"].oneOf(['top', 'bottom']),
|
|
60
73
|
/**
|
|
61
74
|
* Specify whether the `<input>` should be disabled
|
|
62
75
|
*/
|
|
63
76
|
disabled: PropTypes__default["default"].bool,
|
|
77
|
+
/**
|
|
78
|
+
* Additional props passed to Downshift
|
|
79
|
+
*/
|
|
80
|
+
downshiftProps: PropTypes__default["default"].object,
|
|
64
81
|
/**
|
|
65
82
|
* Specify a custom `id` for the `<input>`
|
|
66
83
|
*/
|
|
67
84
|
id: PropTypes__default["default"].string.isRequired,
|
|
68
85
|
/**
|
|
69
|
-
* Allow users to pass in
|
|
70
|
-
*
|
|
86
|
+
* Allow users to pass in arbitrary items from their collection that are
|
|
87
|
+
* pre-selected
|
|
71
88
|
*/
|
|
72
|
-
|
|
89
|
+
initialSelectedItems: PropTypes__default["default"].array,
|
|
73
90
|
/**
|
|
74
91
|
* Specify if the currently selected value is invalid.
|
|
75
92
|
*/
|
|
@@ -107,20 +124,62 @@ FluidMultiSelect.propTypes = {
|
|
|
107
124
|
* this field is for
|
|
108
125
|
*/
|
|
109
126
|
label: PropTypes__default["default"].node.isRequired,
|
|
127
|
+
/**
|
|
128
|
+
* Specify the locale of the control. Used for the default `compareItems`
|
|
129
|
+
* used for sorting the list of items in the control.
|
|
130
|
+
*/
|
|
131
|
+
locale: PropTypes__default["default"].string,
|
|
110
132
|
/**
|
|
111
133
|
* `onChange` is a utility for this controlled component to communicate to a
|
|
112
134
|
* consuming component what kind of internal state changes are occurring.
|
|
113
135
|
*/
|
|
114
136
|
onChange: PropTypes__default["default"].func,
|
|
115
137
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
138
|
+
* **Filterable variant only** - `onInputValueChange` is a utility for this controlled component to communicate to
|
|
139
|
+
* the currently typed input.
|
|
118
140
|
*/
|
|
119
|
-
|
|
141
|
+
onInputValueChange: PropTypes__default["default"].func,
|
|
120
142
|
/**
|
|
121
|
-
*
|
|
143
|
+
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
144
|
+
* consuming component that the menu was open(`true`)/closed(`false`).
|
|
122
145
|
*/
|
|
123
|
-
|
|
146
|
+
onMenuChange: PropTypes__default["default"].func,
|
|
147
|
+
/**
|
|
148
|
+
* Whether or not the Multiselect is readonly
|
|
149
|
+
*/
|
|
150
|
+
readOnly: PropTypes__default["default"].bool,
|
|
151
|
+
/**
|
|
152
|
+
* For full control of the selected items
|
|
153
|
+
*/
|
|
154
|
+
selectedItems: PropTypes__default["default"].array,
|
|
155
|
+
/**
|
|
156
|
+
* Specify feedback (mode) of the selection.
|
|
157
|
+
* `top`: selected item jumps to top
|
|
158
|
+
* `fixed`: selected item stays at it's position
|
|
159
|
+
* `top-after-reopen`: selected item jump to top after reopen dropdown
|
|
160
|
+
*/
|
|
161
|
+
selectionFeedback: PropTypes__default["default"].oneOf(['top', 'fixed', 'top-after-reopen']),
|
|
162
|
+
/**
|
|
163
|
+
* Provide a method that sorts all options in the control. Overriding this
|
|
164
|
+
* prop means that you also have to handle the sort logic for selected versus
|
|
165
|
+
* un-selected items. If you just want to control ordering, consider the
|
|
166
|
+
* `compareItems` prop instead.
|
|
167
|
+
*
|
|
168
|
+
* The return value should be a number whose sign indicates the relative order
|
|
169
|
+
* of the two elements: negative if a is less than b, positive if a is greater
|
|
170
|
+
* than b, and zero if they are equal.
|
|
171
|
+
*
|
|
172
|
+
* sortItems :
|
|
173
|
+
* (items: Array<Item>, {
|
|
174
|
+
* selectedItems: Array<Item>,
|
|
175
|
+
* itemToString: Item => string,
|
|
176
|
+
* compareItems: (itemA: string, itemB: string, {
|
|
177
|
+
* locale: string
|
|
178
|
+
* }) => number,
|
|
179
|
+
* locale: string,
|
|
180
|
+
* }) => Array<Item>
|
|
181
|
+
*/
|
|
182
|
+
sortItems: PropTypes__default["default"].func,
|
|
124
183
|
/**
|
|
125
184
|
* Provide the title text that will be read by a screen reader when
|
|
126
185
|
* visiting this control
|
|
@@ -130,6 +189,10 @@ FluidMultiSelect.propTypes = {
|
|
|
130
189
|
* Callback function for translating ListBoxMenuIcon SVG title
|
|
131
190
|
*/
|
|
132
191
|
translateWithId: PropTypes__default["default"].func,
|
|
192
|
+
/**
|
|
193
|
+
* Specify title to show title on hover
|
|
194
|
+
*/
|
|
195
|
+
useTitleInItem: PropTypes__default["default"].bool,
|
|
133
196
|
/**
|
|
134
197
|
* Specify whether the control is currently in warning state
|
|
135
198
|
*/
|
|
@@ -23,6 +23,7 @@ var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.
|
|
|
23
23
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
24
24
|
var useId = require('../../internal/useId.js');
|
|
25
25
|
var noopFn = require('../../internal/noopFn.js');
|
|
26
|
+
var wrapFocus = require('../../internal/wrapFocus.js');
|
|
26
27
|
var Text = require('../Text/Text.js');
|
|
27
28
|
var match = require('../../internal/keyboard/match.js');
|
|
28
29
|
var keys = require('../../internal/keyboard/keys.js');
|
|
@@ -516,12 +517,40 @@ function ActionableNotification(_ref6) {
|
|
|
516
517
|
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
517
518
|
[`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
|
|
518
519
|
});
|
|
520
|
+
const innerModal = React.useRef(null);
|
|
521
|
+
const startTrap = React.useRef(null);
|
|
522
|
+
const endTrap = React.useRef(null);
|
|
519
523
|
const ref = React.useRef(null);
|
|
520
524
|
useIsomorphicEffect["default"](() => {
|
|
521
|
-
if (
|
|
522
|
-
|
|
525
|
+
if (hasFocus) {
|
|
526
|
+
const button = document.querySelector('button.cds--actionable-notification__action-button');
|
|
527
|
+
button?.focus();
|
|
523
528
|
}
|
|
524
529
|
});
|
|
530
|
+
function handleBlur(_ref7) {
|
|
531
|
+
let {
|
|
532
|
+
target: oldActiveNode,
|
|
533
|
+
relatedTarget: currentActiveNode
|
|
534
|
+
} = _ref7;
|
|
535
|
+
if (isOpen && currentActiveNode && oldActiveNode) {
|
|
536
|
+
const {
|
|
537
|
+
current: bodyNode
|
|
538
|
+
} = innerModal;
|
|
539
|
+
const {
|
|
540
|
+
current: startTrapNode
|
|
541
|
+
} = startTrap;
|
|
542
|
+
const {
|
|
543
|
+
current: endTrapNode
|
|
544
|
+
} = endTrap;
|
|
545
|
+
wrapFocus["default"]({
|
|
546
|
+
bodyNode,
|
|
547
|
+
startTrapNode,
|
|
548
|
+
endTrapNode,
|
|
549
|
+
currentActiveNode,
|
|
550
|
+
oldActiveNode
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
525
554
|
const handleClose = evt => {
|
|
526
555
|
if (!onClose || onClose(evt) !== false) {
|
|
527
556
|
setIsOpen(false);
|
|
@@ -539,8 +568,14 @@ function ActionableNotification(_ref6) {
|
|
|
539
568
|
ref: ref,
|
|
540
569
|
role: role,
|
|
541
570
|
className: containerClassName,
|
|
542
|
-
"aria-labelledby": title ? id : subtitleId
|
|
543
|
-
|
|
571
|
+
"aria-labelledby": title ? id : subtitleId,
|
|
572
|
+
onBlur: handleBlur
|
|
573
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
574
|
+
ref: startTrap,
|
|
575
|
+
tabIndex: 0,
|
|
576
|
+
role: "link",
|
|
577
|
+
className: `${prefix}--visually-hidden`
|
|
578
|
+
}, "Focus sentinel"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
544
579
|
className: `${prefix}--actionable-notification__details`
|
|
545
580
|
}, /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
546
581
|
notificationType: inline ? 'inline' : 'toast',
|
|
@@ -558,14 +593,21 @@ function ActionableNotification(_ref6) {
|
|
|
558
593
|
as: "div",
|
|
559
594
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
560
595
|
id: subtitleId
|
|
561
|
-
}, subtitle), children))),
|
|
596
|
+
}, subtitle), children))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
597
|
+
ref: innerModal
|
|
598
|
+
}, actionButtonLabel && /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|
|
562
599
|
onClick: onActionButtonClick,
|
|
563
600
|
inline: inline
|
|
564
601
|
}, actionButtonLabel), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
565
602
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
566
603
|
notificationType: "actionable",
|
|
567
604
|
onClick: handleCloseButtonClick
|
|
568
|
-
}))
|
|
605
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
606
|
+
ref: endTrap,
|
|
607
|
+
tabIndex: 0,
|
|
608
|
+
role: "link",
|
|
609
|
+
className: `${prefix}--visually-hidden`
|
|
610
|
+
}, "Focus sentinel"));
|
|
569
611
|
}
|
|
570
612
|
ActionableNotification.propTypes = {
|
|
571
613
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
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 from 'react';
|
|
8
|
+
interface SideNavItemsProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
11
|
+
* container
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provide an optional class to be applied to the containing node
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Property to indicate if the side nav container is open (or not). Use to
|
|
20
|
+
* keep local state and styling in step with the SideNav expansion state.
|
|
21
|
+
*/
|
|
22
|
+
isSideNavExpanded?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const SideNavItems: React.FC<SideNavItemsProps>;
|
|
25
|
+
export default SideNavItems;
|
|
@@ -32,8 +32,9 @@ const SideNavItems = _ref => {
|
|
|
32
32
|
const childrenWithExpandedState = React__default["default"].Children.map(children, child => {
|
|
33
33
|
if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
|
|
34
34
|
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
|
|
35
|
+
const childDisplayName = child.type?.displayName;
|
|
35
36
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
36
|
-
...(_utils.CARBON_SIDENAV_ITEMS.includes(
|
|
37
|
+
...(_utils.CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
37
38
|
isSideNavExpanded
|
|
38
39
|
} : {})
|
|
39
40
|
});
|
|
@@ -60,6 +61,5 @@ SideNavItems.propTypes = {
|
|
|
60
61
|
*/
|
|
61
62
|
isSideNavExpanded: PropTypes__default["default"].bool
|
|
62
63
|
};
|
|
63
|
-
var SideNavItems$1 = SideNavItems;
|
|
64
64
|
|
|
65
|
-
exports["default"] = SideNavItems
|
|
65
|
+
exports["default"] = SideNavItems;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.42.
|
|
4
|
+
"version": "1.42.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/runtime": "^7.18.3",
|
|
50
50
|
"@carbon/feature-flags": "^0.16.0",
|
|
51
|
-
"@carbon/icons-react": "^11.30.
|
|
51
|
+
"@carbon/icons-react": "^11.30.1",
|
|
52
52
|
"@carbon/layout": "^11.20.0",
|
|
53
|
-
"@carbon/styles": "^1.42.
|
|
53
|
+
"@carbon/styles": "^1.42.1",
|
|
54
54
|
"@carbon/telemetry": "0.1.0",
|
|
55
55
|
"classnames": "2.3.2",
|
|
56
56
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@babel/preset-react": "^7.22.3",
|
|
79
79
|
"@babel/preset-typescript": "^7.21.5",
|
|
80
80
|
"@carbon/test-utils": "^10.30.0",
|
|
81
|
-
"@carbon/themes": "^11.
|
|
81
|
+
"@carbon/themes": "^11.27.1",
|
|
82
82
|
"@rollup/plugin-babel": "^6.0.0",
|
|
83
83
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
84
84
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"**/*.scss",
|
|
141
141
|
"**/*.css"
|
|
142
142
|
],
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "30bacc5d251cb7579b313091b607b075f98c144c"
|
|
144
144
|
}
|