carbon-react 110.2.1 → 110.2.2
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/esm/components/popover-container/popover-container.component.d.ts +2 -0
- package/esm/components/popover-container/popover-container.component.js +9 -4
- package/lib/components/popover-container/popover-container.component.d.ts +2 -0
- package/lib/components/popover-container/popover-container.component.js +9 -4
- package/package.json +1 -1
|
@@ -16,20 +16,25 @@ const renderOpen = ({
|
|
|
16
16
|
"data-element": dataElement,
|
|
17
17
|
ref,
|
|
18
18
|
"aria-label": ariaLabel,
|
|
19
|
-
id
|
|
19
|
+
id,
|
|
20
|
+
"aria-expanded": ariaExpanded,
|
|
21
|
+
"aria-haspopup": ariaHasPopup
|
|
20
22
|
}) => /*#__PURE__*/React.createElement(PopoverContainerOpenIcon, {
|
|
21
23
|
tabIndex: tabIndex,
|
|
22
24
|
onAction: onClick,
|
|
23
25
|
"data-element": dataElement,
|
|
24
26
|
ref: ref,
|
|
25
27
|
"aria-label": ariaLabel,
|
|
26
|
-
"aria-haspopup":
|
|
28
|
+
"aria-haspopup": ariaHasPopup,
|
|
29
|
+
"aria-expanded": ariaExpanded,
|
|
27
30
|
id: id
|
|
28
31
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
32
|
type: "settings"
|
|
30
33
|
}));
|
|
31
34
|
|
|
32
35
|
renderOpen.propTypes = {
|
|
36
|
+
"aria-expanded": PropTypes.bool.isRequired,
|
|
37
|
+
"aria-haspopup": PropTypes.oneOf(["dialog"]).isRequired,
|
|
33
38
|
"aria-label": PropTypes.string,
|
|
34
39
|
"data-element": PropTypes.string.isRequired,
|
|
35
40
|
"id": PropTypes.string,
|
|
@@ -122,6 +127,8 @@ const PopoverContainer = ({
|
|
|
122
127
|
|
|
123
128
|
const renderOpenComponentProps = {
|
|
124
129
|
tabIndex: isOpen ? -1 : 0,
|
|
130
|
+
"aria-expanded": isOpen,
|
|
131
|
+
"aria-haspopup": "dialog",
|
|
125
132
|
isOpen,
|
|
126
133
|
"data-element": "popover-container-open-component",
|
|
127
134
|
onClick: handleOpenButtonClick,
|
|
@@ -145,8 +152,6 @@ const PopoverContainer = ({
|
|
|
145
152
|
const handleClick = useClickAwayListener(handleClickAway, "mousedown");
|
|
146
153
|
return /*#__PURE__*/React.createElement(PopoverContainerWrapperStyle, {
|
|
147
154
|
"data-component": "popover-container",
|
|
148
|
-
role: "region",
|
|
149
|
-
"aria-labelledby": popoverContainerId,
|
|
150
155
|
onMouseDown: handleClick
|
|
151
156
|
}, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/React.createElement(Transition, {
|
|
152
157
|
in: isOpen,
|
|
@@ -37,20 +37,25 @@ const renderOpen = ({
|
|
|
37
37
|
"data-element": dataElement,
|
|
38
38
|
ref,
|
|
39
39
|
"aria-label": ariaLabel,
|
|
40
|
-
id
|
|
40
|
+
id,
|
|
41
|
+
"aria-expanded": ariaExpanded,
|
|
42
|
+
"aria-haspopup": ariaHasPopup
|
|
41
43
|
}) => /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerOpenIcon, {
|
|
42
44
|
tabIndex: tabIndex,
|
|
43
45
|
onAction: onClick,
|
|
44
46
|
"data-element": dataElement,
|
|
45
47
|
ref: ref,
|
|
46
48
|
"aria-label": ariaLabel,
|
|
47
|
-
"aria-haspopup":
|
|
49
|
+
"aria-haspopup": ariaHasPopup,
|
|
50
|
+
"aria-expanded": ariaExpanded,
|
|
48
51
|
id: id
|
|
49
52
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
50
53
|
type: "settings"
|
|
51
54
|
}));
|
|
52
55
|
|
|
53
56
|
renderOpen.propTypes = {
|
|
57
|
+
"aria-expanded": _propTypes.default.bool.isRequired,
|
|
58
|
+
"aria-haspopup": _propTypes.default.oneOf(["dialog"]).isRequired,
|
|
54
59
|
"aria-label": _propTypes.default.string,
|
|
55
60
|
"data-element": _propTypes.default.string.isRequired,
|
|
56
61
|
"id": _propTypes.default.string,
|
|
@@ -143,6 +148,8 @@ const PopoverContainer = ({
|
|
|
143
148
|
|
|
144
149
|
const renderOpenComponentProps = {
|
|
145
150
|
tabIndex: isOpen ? -1 : 0,
|
|
151
|
+
"aria-expanded": isOpen,
|
|
152
|
+
"aria-haspopup": "dialog",
|
|
146
153
|
isOpen,
|
|
147
154
|
"data-element": "popover-container-open-component",
|
|
148
155
|
onClick: handleOpenButtonClick,
|
|
@@ -166,8 +173,6 @@ const PopoverContainer = ({
|
|
|
166
173
|
const handleClick = (0, _useClickAwayListener.default)(handleClickAway, "mousedown");
|
|
167
174
|
return /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerWrapperStyle, {
|
|
168
175
|
"data-component": "popover-container",
|
|
169
|
-
role: "region",
|
|
170
|
-
"aria-labelledby": popoverContainerId,
|
|
171
176
|
onMouseDown: handleClick
|
|
172
177
|
}, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
|
|
173
178
|
in: isOpen,
|