carbon-react 110.2.3 → 110.4.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/esm/__internal__/radio-button-mapper/index.d.ts +2 -0
- package/esm/__internal__/radio-button-mapper/index.js +1 -0
- package/esm/__internal__/radio-button-mapper/radio-button-mapper.d.ts +21 -0
- package/esm/__internal__/sticky-footer/index.d.ts +1 -0
- package/esm/__internal__/sticky-footer/sticky-footer.component.d.ts +15 -0
- package/esm/__internal__/sticky-footer/sticky-footer.style.d.ts +2 -0
- package/esm/__internal__/utils/helpers/tags/index.d.ts +1 -0
- package/esm/__spec_helper__/mock-resize-observer.d.ts +1 -1
- package/esm/__spec_helper__/mock-resize-observer.js +2 -2
- package/esm/components/button-toggle/button-toggle.component.d.ts +3 -3
- package/esm/components/button-toggle/button-toggle.component.js +21 -20
- package/esm/components/button-toggle/button-toggle.style.d.ts +1 -1
- package/esm/components/button-toggle-group/button-toggle-group.component.d.ts +45 -0
- package/esm/components/button-toggle-group/button-toggle-group.component.js +187 -92
- package/esm/components/button-toggle-group/button-toggle-group.style.d.ts +4 -0
- package/esm/components/button-toggle-group/button-toggle-group.style.js +2 -2
- package/esm/components/button-toggle-group/index.d.ts +2 -1
- package/esm/components/definition-list/dd.component.d.ts +4 -1
- package/esm/components/definition-list/dd.component.js +1 -0
- package/esm/components/definition-list/dl.component.d.ts +4 -1
- package/esm/components/definition-list/dl.component.js +1 -0
- package/esm/components/definition-list/dt.component.d.ts +4 -1
- package/esm/components/definition-list/dt.component.js +1 -0
- package/esm/components/drawer/drawer.component.d.ts +37 -0
- package/esm/components/drawer/drawer.component.js +43 -54
- package/esm/components/drawer/drawer.style.d.ts +27 -0
- package/esm/components/drawer/drawer.style.js +2 -2
- package/esm/components/drawer/index.d.ts +2 -1
- package/esm/components/drawer/index.js +1 -2
- package/esm/components/menu/__internal__/submenu/submenu.component.js +22 -4
- package/esm/components/menu/menu-item/menu-item.component.js +6 -1
- package/esm/components/menu/menu-item/menu-item.d.ts +4 -0
- package/esm/components/menu/menu-item/menu-item.style.js +158 -149
- package/esm/components/menu/scrollable-block/scrollable-block.component.js +21 -5
- package/esm/components/menu/scrollable-block/scrollable-block.d.ts +6 -0
- package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -0
- package/esm/components/tabs/tab/tab.style.d.ts +2 -0
- package/esm/components/tabs/tabs.style.d.ts +2 -0
- package/lib/__internal__/radio-button-mapper/index.d.ts +2 -0
- package/lib/{components/button-toggle-group/documentation → __internal__/radio-button-mapper}/index.js +2 -2
- package/lib/__internal__/radio-button-mapper/package.json +6 -0
- package/lib/__internal__/radio-button-mapper/radio-button-mapper.d.ts +21 -0
- package/lib/__internal__/sticky-footer/index.d.ts +1 -0
- package/lib/__internal__/sticky-footer/sticky-footer.component.d.ts +15 -0
- package/lib/__internal__/sticky-footer/sticky-footer.style.d.ts +2 -0
- package/lib/__internal__/utils/helpers/tags/index.d.ts +1 -0
- package/lib/__spec_helper__/mock-resize-observer.d.ts +1 -1
- package/lib/__spec_helper__/mock-resize-observer.js +2 -2
- package/lib/components/button-toggle/button-toggle.component.d.ts +3 -3
- package/lib/components/button-toggle/button-toggle.component.js +22 -20
- package/lib/components/button-toggle/button-toggle.style.d.ts +1 -1
- package/lib/components/button-toggle-group/button-toggle-group.component.d.ts +45 -0
- package/lib/components/button-toggle-group/button-toggle-group.component.js +190 -93
- package/lib/components/button-toggle-group/button-toggle-group.style.d.ts +4 -0
- package/lib/components/button-toggle-group/button-toggle-group.style.js +2 -2
- package/lib/components/button-toggle-group/index.d.ts +2 -1
- package/lib/components/definition-list/dd.component.d.ts +4 -1
- package/lib/components/definition-list/dd.component.js +1 -0
- package/lib/components/definition-list/dl.component.d.ts +4 -1
- package/lib/components/definition-list/dl.component.js +1 -0
- package/lib/components/definition-list/dt.component.d.ts +4 -1
- package/lib/components/definition-list/dt.component.js +1 -0
- package/lib/components/drawer/drawer.component.d.ts +37 -0
- package/lib/components/drawer/drawer.component.js +43 -55
- package/lib/components/drawer/drawer.style.d.ts +27 -0
- package/lib/components/drawer/drawer.style.js +3 -3
- package/lib/components/drawer/index.d.ts +2 -1
- package/lib/components/menu/__internal__/submenu/submenu.component.js +23 -4
- package/lib/components/menu/menu-item/menu-item.component.js +6 -1
- package/lib/components/menu/menu-item/menu-item.d.ts +4 -0
- package/lib/components/menu/menu-item/menu-item.style.js +158 -149
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +22 -5
- package/lib/components/menu/scrollable-block/scrollable-block.d.ts +6 -0
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -0
- package/lib/components/tabs/tab/tab.style.d.ts +2 -0
- package/lib/components/tabs/tabs.style.d.ts +2 -0
- package/package.json +1 -1
- package/esm/components/button-toggle-group/__definition__.js +0 -38
- package/esm/components/button-toggle-group/button-toggle-group.d.ts +0 -58
- package/esm/components/button-toggle-group/documentation/index.js +0 -1
- package/esm/components/drawer/drawer.d.ts +0 -44
- package/lib/components/button-toggle-group/__definition__.js +0 -50
- package/lib/components/button-toggle-group/button-toggle-group.d.ts +0 -58
- package/lib/components/button-toggle-group/documentation/package.json +0 -6
- package/lib/components/drawer/drawer.d.ts +0 -44
|
@@ -15,6 +15,7 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
15
15
|
clickToOpen,
|
|
16
16
|
maxWidth,
|
|
17
17
|
inFullscreenView,
|
|
18
|
+
overrideColor,
|
|
18
19
|
as
|
|
19
20
|
}) => css`
|
|
20
21
|
display: inline-block;
|
|
@@ -23,43 +24,51 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
23
24
|
height: 40px;
|
|
24
25
|
position: relative;
|
|
25
26
|
cursor: pointer;
|
|
26
|
-
|
|
27
|
+
${!overrideColor && css`
|
|
28
|
+
background-color: ${menuConfigVariants[menuType].background};
|
|
29
|
+
`}};
|
|
30
|
+
|
|
31
|
+
${overrideColor && css`
|
|
32
|
+
&&&& {
|
|
33
|
+
background-color: ${variant === "alternate" ? menuConfigVariants[menuType].alternate : menuConfigVariants[menuType].submenuItemBackground};
|
|
34
|
+
}
|
|
35
|
+
`}
|
|
27
36
|
|
|
28
37
|
${!inFullscreenView && css`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
a:focus,
|
|
44
|
-
button:focus {
|
|
45
|
-
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
46
|
-
var(--colorsSemanticFocus500);
|
|
47
|
-
background-color: ${menuConfigVariants[menuType].background};
|
|
48
|
-
color: ${menuConfigVariants[menuType].color};
|
|
49
|
-
z-index: 1;
|
|
50
|
-
position: relative;
|
|
51
|
-
}
|
|
38
|
+
max-width: inherit;
|
|
39
|
+
|
|
40
|
+
a,
|
|
41
|
+
button {
|
|
42
|
+
${maxWidth && css`
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
max-width: inherit;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
vertical-align: bottom;
|
|
49
|
+
`}
|
|
50
|
+
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
a:focus,
|
|
53
|
+
button:focus {
|
|
54
|
+
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
55
|
+
var(--colorsSemanticFocus500);
|
|
56
|
+
background-color: ${menuConfigVariants[menuType].background};
|
|
57
|
+
color: ${menuConfigVariants[menuType].color};
|
|
58
|
+
z-index: 1;
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
a:hover,
|
|
63
|
+
button:hover {
|
|
64
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
59
65
|
color: var(--colorsComponentsMenuYang100);
|
|
66
|
+
|
|
67
|
+
[data-component="icon"] {
|
|
68
|
+
color: var(--colorsComponentsMenuYang100);
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
|
-
}
|
|
62
|
-
`}
|
|
71
|
+
`}
|
|
63
72
|
|
|
64
73
|
a,
|
|
65
74
|
${StyledLink} a,
|
|
@@ -92,159 +101,159 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
92
101
|
}
|
|
93
102
|
|
|
94
103
|
${selected && css`
|
|
95
|
-
background-color: ${menuConfigVariants[menuType].selected};
|
|
96
|
-
|
|
97
|
-
a:focus,
|
|
98
|
-
button:focus {
|
|
99
104
|
background-color: ${menuConfigVariants[menuType].selected};
|
|
100
|
-
}
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
a:focus,
|
|
107
|
+
button:focus {
|
|
108
|
+
background-color: ${menuConfigVariants[menuType].selected};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
a:hover,
|
|
112
|
+
button:hover {
|
|
113
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
114
|
+
}
|
|
115
|
+
`}
|
|
107
116
|
|
|
108
117
|
${variant === "alternate" && !inFullscreenView && css`
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
&&& {
|
|
119
|
+
background-color: ${menuConfigVariants[menuType].alternate};
|
|
120
|
+
}
|
|
112
121
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
&&& a:focus,
|
|
123
|
+
&&& button:focus {
|
|
124
|
+
background-color: ${menuConfigVariants[menuType].alternate};
|
|
125
|
+
}
|
|
117
126
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
&&& a:hover,
|
|
128
|
+
&&& button:hover {
|
|
129
|
+
background-color: ${menuConfigVariants[menuType].alternateHover};
|
|
130
|
+
}
|
|
131
|
+
`}
|
|
123
132
|
|
|
124
133
|
${isOpen && css`
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
a,
|
|
135
|
+
button {
|
|
136
|
+
background-color: ${menuConfigVariants[menuType].submenuItemBackground};
|
|
137
|
+
color: ${menuConfigVariants[menuType].color};
|
|
138
|
+
}
|
|
139
|
+
`}
|
|
131
140
|
|
|
132
141
|
${hasSubmenu && css`
|
|
133
|
-
background-color: ${menuConfigVariants[menuType].submenuBackground};
|
|
134
|
-
|
|
135
|
-
a:focus,
|
|
136
|
-
button:focus {
|
|
137
142
|
background-color: ${menuConfigVariants[menuType].submenuBackground};
|
|
138
|
-
color: ${menuConfigVariants[menuType].color};
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
a:focus,
|
|
145
|
+
button:focus {
|
|
146
|
+
background-color: ${menuConfigVariants[menuType].submenuBackground};
|
|
141
147
|
color: ${menuConfigVariants[menuType].color};
|
|
148
|
+
|
|
149
|
+
[data-component="icon"] {
|
|
150
|
+
color: ${menuConfigVariants[menuType].color};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
${clickToOpen && isOpen && css`
|
|
154
|
+
background-color: ${menuConfigVariants[menuType].submenuOpenedBackground};
|
|
155
|
+
`}
|
|
142
156
|
}
|
|
143
157
|
|
|
144
|
-
|
|
158
|
+
a:hover,
|
|
159
|
+
button:hover {
|
|
145
160
|
background-color: ${menuConfigVariants[menuType].submenuOpenedBackground};
|
|
146
|
-
|
|
147
|
-
}
|
|
161
|
+
color: var(--colorsComponentsMenuYang100);
|
|
148
162
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
163
|
+
${!(href || clickToOpen) && css`
|
|
164
|
+
cursor: default;
|
|
165
|
+
background-color: ${menuConfigVariants[menuType].submenuItemBackground};
|
|
166
|
+
color: ${menuConfigVariants[menuType].color};
|
|
167
|
+
`}
|
|
153
168
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
color: ${menuConfigVariants[menuType].color};
|
|
158
|
-
`}
|
|
159
|
-
|
|
160
|
-
[data-component="icon"] {
|
|
161
|
-
color: ${menuConfigVariants[menuType].color};
|
|
169
|
+
[data-component="icon"] {
|
|
170
|
+
color: ${menuConfigVariants[menuType].color};
|
|
171
|
+
}
|
|
162
172
|
}
|
|
163
|
-
}
|
|
164
173
|
|
|
165
|
-
|
|
166
|
-
background-color: ${menuConfigVariants[menuType].submenuSelected};
|
|
167
|
-
|
|
168
|
-
a:focus,
|
|
169
|
-
button:focus {
|
|
174
|
+
${selected && css`
|
|
170
175
|
background-color: ${menuConfigVariants[menuType].submenuSelected};
|
|
171
|
-
}
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
`}
|
|
177
|
+
a:focus,
|
|
178
|
+
button:focus {
|
|
179
|
+
background-color: ${menuConfigVariants[menuType].submenuSelected};
|
|
180
|
+
}
|
|
179
181
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
a:hover,
|
|
183
|
+
button:hover {
|
|
184
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
185
|
+
color: var(--colorsComponentsMenuYang100);
|
|
186
|
+
}
|
|
187
|
+
`}
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
189
|
+
${showDropdownArrow && css`
|
|
190
|
+
> a,
|
|
191
|
+
> button {
|
|
192
|
+
padding-right: 32px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
a::before,
|
|
196
|
+
button::before {
|
|
197
|
+
display: block;
|
|
198
|
+
margin-top: -2px;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
position: absolute;
|
|
201
|
+
right: 16px;
|
|
202
|
+
top: 50%;
|
|
203
|
+
z-index: 2;
|
|
204
|
+
content: "";
|
|
205
|
+
width: 0;
|
|
206
|
+
height: 0;
|
|
207
|
+
border-top: 5px solid ${menuConfigVariants[menuType].text};
|
|
208
|
+
border-right: 4px solid transparent;
|
|
209
|
+
border-bottom: 4px solid transparent;
|
|
210
|
+
border-left: 4px solid transparent;
|
|
211
|
+
}
|
|
212
|
+
`}
|
|
213
|
+
`}
|
|
205
214
|
|
|
206
215
|
${isSearch && css`
|
|
207
|
-
|
|
208
|
-
|
|
216
|
+
padding: 2px 16px;
|
|
217
|
+
`}
|
|
209
218
|
|
|
210
219
|
${inFullscreenView && css`
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
220
|
+
${as === "div" && css`
|
|
221
|
+
cursor: default;
|
|
222
|
+
padding: 0 16px;
|
|
214
223
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
224
|
+
:hover {
|
|
225
|
+
background: transparent;
|
|
226
|
+
}
|
|
227
|
+
`}
|
|
219
228
|
|
|
220
|
-
|
|
229
|
+
a,
|
|
221
230
|
${StyledLink} a,
|
|
222
231
|
button,
|
|
223
232
|
${StyledLink} button {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
color: var(--colorsComponentsMenuYang100);
|
|
242
|
-
|
|
243
|
-
[data-component="icon"] {
|
|
233
|
+
width: 100vw;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
a:focus,
|
|
238
|
+
button:focus {
|
|
239
|
+
box-shadow: inset 0 0 0 var(--borderWidth300)
|
|
240
|
+
var(--colorsSemanticFocus500);
|
|
241
|
+
z-index: 1;
|
|
242
|
+
position: relative;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
a:focus,
|
|
246
|
+
a:hover,
|
|
247
|
+
button:focus,
|
|
248
|
+
button:hover {
|
|
249
|
+
background-color: var(--colorsComponentsMenuAutumnStandard600);
|
|
244
250
|
color: var(--colorsComponentsMenuYang100);
|
|
251
|
+
|
|
252
|
+
[data-component="icon"] {
|
|
253
|
+
color: var(--colorsComponentsMenuYang100);
|
|
254
|
+
}
|
|
245
255
|
}
|
|
246
|
-
}
|
|
247
|
-
`}
|
|
256
|
+
`}
|
|
248
257
|
`}
|
|
249
258
|
`;
|
|
250
259
|
export default StyledMenuItemWrapper;
|
|
@@ -3,6 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React, { useContext } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import MenuContext from "../menu.context";
|
|
6
|
+
import MenuItem from "../menu-item";
|
|
6
7
|
import SubmenuContext from "../__internal__/submenu/submenu.context";
|
|
7
8
|
import StyledScrollableBlock from "./scrollable-block.style";
|
|
8
9
|
import Box from "../../box";
|
|
@@ -11,6 +12,8 @@ const ScrollableBlock = ({
|
|
|
11
12
|
children,
|
|
12
13
|
height,
|
|
13
14
|
variant = "default",
|
|
15
|
+
parent,
|
|
16
|
+
parentVariant,
|
|
14
17
|
...rest
|
|
15
18
|
}) => {
|
|
16
19
|
const menuContext = useContext(MenuContext);
|
|
@@ -29,14 +32,19 @@ const ScrollableBlock = ({
|
|
|
29
32
|
return /*#__PURE__*/React.createElement(StyledScrollableBlock, _extends({
|
|
30
33
|
"data-component": "submenu-scrollable-block",
|
|
31
34
|
menuType: menuContext.menuType,
|
|
32
|
-
variant: variant
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
variant: variant
|
|
36
|
+
}, rest), parent && /*#__PURE__*/React.createElement(MenuItem, {
|
|
37
|
+
overrideColor: true,
|
|
38
|
+
variant: parentVariant,
|
|
39
|
+
as: "div",
|
|
40
|
+
href: "#"
|
|
41
|
+
}, parent), /*#__PURE__*/React.createElement(Box, {
|
|
35
42
|
overflowY: "scroll",
|
|
36
43
|
scrollVariant: scrollVariants[menuContext.menuType],
|
|
37
44
|
height: height,
|
|
38
45
|
p: 0,
|
|
39
|
-
|
|
46
|
+
as: "ul",
|
|
47
|
+
role: "list"
|
|
40
48
|
}, React.Children.map(children, (child, index) => {
|
|
41
49
|
let isFocused = false;
|
|
42
50
|
const blockItemFocused = focusIndex >= blockIndex;
|
|
@@ -62,6 +70,14 @@ ScrollableBlock.propTypes = {
|
|
|
62
70
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
63
71
|
|
|
64
72
|
/** set the colour variant for a menuType */
|
|
65
|
-
variant: PropTypes.oneOf(["default", "alternate"])
|
|
73
|
+
variant: PropTypes.oneOf(["default", "alternate"]),
|
|
74
|
+
|
|
75
|
+
/** the element, if any, displayed at the top of the block to be its semantic "parent",
|
|
76
|
+
* but not part of the scrollable section
|
|
77
|
+
*/
|
|
78
|
+
parent: PropTypes.node,
|
|
79
|
+
|
|
80
|
+
/** the colour variant for the parent element, if different from the variant of the block */
|
|
81
|
+
parentVariant: PropTypes.oneOf(["default", "alternate"])
|
|
66
82
|
};
|
|
67
83
|
export default ScrollableBlock;
|
|
@@ -7,6 +7,12 @@ export interface ScrollableBlockProps {
|
|
|
7
7
|
height?: string | number;
|
|
8
8
|
/** set the colour variant for a menuType */
|
|
9
9
|
variant?: "default" | "alternate";
|
|
10
|
+
/** the element, if any, displayed at the top of the block to be its semantic "parent",
|
|
11
|
+
* but not part of the scrollable section
|
|
12
|
+
*/
|
|
13
|
+
parent?: React.ReactElement;
|
|
14
|
+
/** the colour variant for the parent element, if different from the variant of the block */
|
|
15
|
+
parentVariant?: "default" | "alternate";
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
declare function ScrollableBlock(props: ScrollableBlockProps): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import StyledMenuItemWrapper from "../menu-item/menu-item.style";
|
|
3
3
|
import menuConfigVariants from "../menu.config";
|
|
4
|
-
const StyledScrollableBlock = styled.
|
|
4
|
+
const StyledScrollableBlock = styled.li`
|
|
5
5
|
${({
|
|
6
6
|
menuType,
|
|
7
7
|
variant
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const StyledTabsHeaderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export const StyledTabsHeaderList: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
alternateStyling: any;
|
|
4
|
+
isInSidebar: any;
|
|
5
|
+
position: any;
|
|
6
|
+
}, never>;
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _radioButtonMapper.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _radioButtonMapper = _interopRequireDefault(require("./radio-button-mapper.component"));
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface RadioButtonMapperProps {
|
|
4
|
+
/** The RadioButton objects to be rendered in the group */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Specifies the name prop to be applied to each button in the group */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Callback fired when each RadioButton is blurred */
|
|
9
|
+
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
10
|
+
/** Callback fired when the user selects a RadioButton */
|
|
11
|
+
onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
/** Callback fired on key down */
|
|
13
|
+
onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** Value of the selected RadioButton */
|
|
15
|
+
value?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare function RadioButtonMapper(props?: RadioButtonMapperProps): JSX.Element;
|
|
19
|
+
RadioButtonMapper.displayName = "RadioButtonMapper";
|
|
20
|
+
|
|
21
|
+
export default RadioButtonMapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./sticky-footer.component";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default StickyFooter;
|
|
2
|
+
declare function StickyFooter({ children, containerRef, disableSticky, ...rest }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
children: any;
|
|
5
|
+
containerRef: any;
|
|
6
|
+
disableSticky: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare namespace StickyFooter {
|
|
9
|
+
namespace propTypes {
|
|
10
|
+
const children: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
11
|
+
const containerRef: PropTypes.Validator<any>;
|
|
12
|
+
const disableSticky: PropTypes.Requireable<boolean>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import PropTypes from "prop-types";
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
const setupResizeObserverMock = () => {
|
|
9
|
-
if (!
|
|
9
|
+
if (!window) {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(() => ({
|
|
14
14
|
disconnect: jest.fn(),
|
|
15
15
|
observe: jest.fn(),
|
|
16
16
|
unobserve: jest.fn()
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { StyledButtonToggleLabelProps } from "./button-toggle.style";
|
|
3
3
|
import { ButtonToggleInputProps } from "./button-toggle-input.component";
|
|
4
4
|
export interface ButtonToggleProps extends ButtonToggleInputProps, Partial<StyledButtonToggleLabelProps> {
|
|
5
|
-
/**
|
|
6
|
-
children
|
|
5
|
+
/** Text to display for the button. */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
7
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
8
8
|
"data-component"?: string;
|
|
9
9
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
@@ -18,7 +18,7 @@ export interface ButtonToggleProps extends ButtonToggleInputProps, Partial<Style
|
|
|
18
18
|
onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
19
19
|
}
|
|
20
20
|
export declare const ButtonToggle: {
|
|
21
|
-
(
|
|
21
|
+
({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, buttonIcon, buttonIconSize, checked, children, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, disabled, grouped, name, onBlur, onChange, onFocus, size, value, }: ButtonToggleProps): JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
24
|
export default ButtonToggle;
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
13
|
+
|
|
12
14
|
var _buttonToggle = require("./button-toggle.style");
|
|
13
15
|
|
|
14
16
|
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
|
|
@@ -25,26 +27,26 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
25
27
|
|
|
26
28
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
29
|
|
|
28
|
-
const ButtonToggle =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
const ButtonToggle = ({
|
|
31
|
+
"aria-label": ariaLabel,
|
|
32
|
+
"aria-labelledby": ariaLabelledBy,
|
|
33
|
+
buttonIcon,
|
|
34
|
+
buttonIconSize = "small",
|
|
35
|
+
checked,
|
|
36
|
+
children,
|
|
37
|
+
"data-component": dataComponent,
|
|
38
|
+
"data-element": dataElement,
|
|
39
|
+
"data-role": dataRole,
|
|
40
|
+
disabled,
|
|
41
|
+
grouped,
|
|
42
|
+
name,
|
|
43
|
+
onBlur,
|
|
44
|
+
onChange,
|
|
45
|
+
onFocus,
|
|
46
|
+
size = "medium",
|
|
47
|
+
value
|
|
48
|
+
}) => {
|
|
49
|
+
!!!(children || buttonIcon) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, "Either prop `buttonIcon` must be defined, or this node must have children") : (0, _invariant.default)(false) : void 0;
|
|
48
50
|
const {
|
|
49
51
|
onMouseEnter,
|
|
50
52
|
onMouseLeave
|
|
@@ -2,7 +2,7 @@ import { IconType } from "../icon";
|
|
|
2
2
|
export declare type ButtonToggleIconSizes = "small" | "large";
|
|
3
3
|
declare const StyledButtonToggleContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export interface StyledButtonToggleLabelProps {
|
|
5
|
-
/**
|
|
5
|
+
/** The icon to be rendered inside of the button */
|
|
6
6
|
buttonIcon?: IconType;
|
|
7
7
|
/** Sets the size of the buttonIcon (eg. large) */
|
|
8
8
|
buttonIconSize?: ButtonToggleIconSizes;
|