carbon-react 117.4.1 → 117.6.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.
Files changed (138) hide show
  1. package/esm/__internal__/input/input.component.d.ts +3 -3
  2. package/esm/components/advanced-color-picker/advanced-color-picker.component.js +8 -0
  3. package/esm/components/button-toggle/button-toggle.component.js +7 -0
  4. package/esm/components/checkbox/checkbox.component.js +6 -0
  5. package/esm/components/decimal/decimal.component.js +7 -0
  6. package/esm/components/grouped-character/grouped-character.component.js +6 -0
  7. package/esm/components/menu/__internal__/locators.d.ts +6 -6
  8. package/esm/components/menu/__internal__/spec-helper/index.d.ts +3 -0
  9. package/esm/components/menu/__internal__/submenu/index.d.ts +2 -0
  10. package/esm/components/menu/__internal__/submenu/index.js +1 -0
  11. package/esm/components/menu/__internal__/submenu/submenu.component.d.ts +42 -0
  12. package/esm/components/menu/__internal__/submenu/submenu.component.js +162 -85
  13. package/esm/components/menu/__internal__/submenu/submenu.context.d.ts +10 -0
  14. package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +16 -0
  15. package/esm/components/menu/__internal__/submenu/submenu.style.js +4 -4
  16. package/esm/components/menu/index.d.ts +12 -6
  17. package/esm/components/menu/index.js +5 -5
  18. package/esm/components/menu/menu-divider/index.d.ts +2 -2
  19. package/esm/components/menu/menu-divider/index.js +1 -0
  20. package/esm/components/menu/menu-divider/menu-divider.component.d.ts +7 -0
  21. package/esm/components/menu/menu-divider/menu-divider.component.js +14 -7
  22. package/esm/components/menu/menu-divider/menu-divider.style.d.ts +6 -0
  23. package/esm/components/menu/menu-full-screen/index.d.ts +2 -2
  24. package/esm/components/menu/menu-full-screen/menu-full-screen.component.d.ts +14 -0
  25. package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +20 -30
  26. package/esm/components/menu/menu-full-screen/menu-full-screen.style.d.ts +8 -0
  27. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +29 -27
  28. package/esm/components/menu/menu-item/index.d.ts +2 -2
  29. package/esm/components/menu/menu-item/menu-item.component.d.ts +67 -0
  30. package/esm/components/menu/menu-item/menu-item.component.js +2084 -121
  31. package/esm/components/menu/menu-item/menu-item.style.d.ts +21 -0
  32. package/esm/components/menu/menu-item/menu-item.style.js +188 -146
  33. package/esm/components/menu/menu-segment-title/index.d.ts +2 -2
  34. package/esm/components/menu/menu-segment-title/index.js +1 -0
  35. package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +10 -0
  36. package/esm/components/menu/menu-segment-title/menu-segment-title.component.js +13 -9
  37. package/esm/components/menu/menu-segment-title/menu-segment-title.style.d.ts +8 -0
  38. package/esm/components/menu/menu.component.d.ts +11 -9
  39. package/esm/components/menu/menu.component.js +1887 -18
  40. package/esm/components/menu/menu.config.d.ts +58 -94
  41. package/esm/components/menu/menu.context.d.ts +12 -6
  42. package/esm/components/menu/menu.style.d.ts +12 -2
  43. package/esm/components/menu/menu.style.js +11 -11
  44. package/esm/components/menu/scrollable-block/index.d.ts +2 -1
  45. package/esm/components/menu/scrollable-block/scrollable-block.component.d.ts +19 -0
  46. package/esm/components/menu/scrollable-block/scrollable-block.component.js +13 -20
  47. package/esm/components/menu/scrollable-block/scrollable-block.style.d.ts +8 -0
  48. package/esm/components/number/number.component.js +6 -0
  49. package/esm/components/numeral-date/numeral-date.component.js +8 -0
  50. package/esm/components/radio-button/radio-button-group.component.js +8 -0
  51. package/esm/components/radio-button/radio-button.style.js +1 -1
  52. package/esm/components/search/search.component.js +6 -0
  53. package/esm/components/select/filterable-select/filterable-select.component.js +9 -1
  54. package/esm/components/select/multi-select/multi-select.component.js +9 -1
  55. package/esm/components/select/simple-select/simple-select.component.js +9 -1
  56. package/esm/components/simple-color-picker/simple-color-picker.component.js +8 -0
  57. package/esm/components/switch/switch.component.js +6 -0
  58. package/esm/components/textarea/textarea.component.js +6 -0
  59. package/esm/components/textbox/textbox.component.js +6 -0
  60. package/esm/components/vertical-menu/vertical-menu-item.component.d.ts +3 -1
  61. package/esm/components/vertical-menu/vertical-menu-item.component.js +3 -1
  62. package/lib/__internal__/input/input.component.d.ts +3 -3
  63. package/lib/components/advanced-color-picker/advanced-color-picker.component.js +11 -0
  64. package/lib/components/button-toggle/button-toggle.component.js +10 -0
  65. package/lib/components/checkbox/checkbox.component.js +7 -0
  66. package/lib/components/decimal/decimal.component.js +8 -0
  67. package/lib/components/grouped-character/grouped-character.component.js +7 -0
  68. package/lib/components/menu/__internal__/locators.d.ts +6 -6
  69. package/lib/components/menu/__internal__/spec-helper/index.d.ts +3 -0
  70. package/lib/components/menu/__internal__/submenu/index.d.ts +2 -0
  71. package/lib/components/menu/__internal__/submenu/index.js +15 -0
  72. package/lib/components/menu/__internal__/submenu/package.json +6 -0
  73. package/lib/components/menu/__internal__/submenu/submenu.component.d.ts +42 -0
  74. package/lib/components/menu/__internal__/submenu/submenu.component.js +162 -86
  75. package/lib/components/menu/__internal__/submenu/submenu.context.d.ts +10 -0
  76. package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +16 -0
  77. package/lib/components/menu/__internal__/submenu/submenu.style.js +4 -4
  78. package/lib/components/menu/index.d.ts +12 -6
  79. package/lib/components/menu/index.js +5 -5
  80. package/lib/components/menu/menu-divider/index.d.ts +2 -2
  81. package/lib/components/menu/menu-divider/index.js +15 -0
  82. package/lib/components/menu/menu-divider/menu-divider.component.d.ts +7 -0
  83. package/lib/components/menu/menu-divider/menu-divider.component.js +15 -7
  84. package/lib/components/menu/menu-divider/menu-divider.style.d.ts +6 -0
  85. package/lib/components/menu/menu-divider/package.json +6 -0
  86. package/lib/components/menu/menu-full-screen/index.d.ts +2 -2
  87. package/lib/components/menu/menu-full-screen/menu-full-screen.component.d.ts +14 -0
  88. package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +22 -31
  89. package/lib/components/menu/menu-full-screen/menu-full-screen.style.d.ts +8 -0
  90. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +30 -28
  91. package/lib/components/menu/menu-item/index.d.ts +2 -2
  92. package/lib/components/menu/menu-item/menu-item.component.d.ts +67 -0
  93. package/lib/components/menu/menu-item/menu-item.component.js +2085 -122
  94. package/lib/components/menu/menu-item/menu-item.style.d.ts +21 -0
  95. package/lib/components/menu/menu-item/menu-item.style.js +191 -146
  96. package/lib/components/menu/menu-segment-title/index.d.ts +2 -2
  97. package/lib/components/menu/menu-segment-title/index.js +15 -0
  98. package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +10 -0
  99. package/lib/components/menu/menu-segment-title/menu-segment-title.component.js +14 -9
  100. package/lib/components/menu/menu-segment-title/menu-segment-title.style.d.ts +8 -0
  101. package/lib/components/menu/menu-segment-title/package.json +6 -0
  102. package/lib/components/menu/menu.component.d.ts +11 -9
  103. package/lib/components/menu/menu.component.js +1889 -20
  104. package/lib/components/menu/menu.config.d.ts +58 -94
  105. package/lib/components/menu/menu.context.d.ts +12 -6
  106. package/lib/components/menu/menu.style.d.ts +12 -2
  107. package/lib/components/menu/menu.style.js +12 -12
  108. package/lib/components/menu/scrollable-block/index.d.ts +2 -1
  109. package/lib/components/menu/scrollable-block/scrollable-block.component.d.ts +19 -0
  110. package/lib/components/menu/scrollable-block/scrollable-block.component.js +15 -21
  111. package/lib/components/menu/scrollable-block/scrollable-block.style.d.ts +8 -0
  112. package/lib/components/number/number.component.js +7 -0
  113. package/lib/components/numeral-date/numeral-date.component.js +10 -0
  114. package/lib/components/radio-button/radio-button-group.component.js +11 -0
  115. package/lib/components/radio-button/radio-button.style.js +1 -1
  116. package/lib/components/search/search.component.js +7 -0
  117. package/lib/components/select/filterable-select/filterable-select.component.js +10 -1
  118. package/lib/components/select/multi-select/multi-select.component.js +10 -1
  119. package/lib/components/select/simple-select/simple-select.component.js +10 -1
  120. package/lib/components/simple-color-picker/simple-color-picker.component.js +11 -0
  121. package/lib/components/switch/switch.component.js +7 -0
  122. package/lib/components/textarea/textarea.component.js +7 -0
  123. package/lib/components/textbox/textbox.component.js +7 -0
  124. package/lib/components/vertical-menu/vertical-menu-item.component.d.ts +3 -1
  125. package/lib/components/vertical-menu/vertical-menu-item.component.js +3 -1
  126. package/package.json +2 -2
  127. package/esm/components/menu/menu-divider/menu-divider.d.ts +0 -11
  128. package/esm/components/menu/menu-full-screen/menu-full-screen.d.ts +0 -16
  129. package/esm/components/menu/menu-item/menu-item.d.ts +0 -60
  130. package/esm/components/menu/menu-segment-title/menu-segment-title.d.ts +0 -12
  131. package/esm/components/menu/menu.d.ts +0 -28
  132. package/esm/components/menu/scrollable-block/scrollable-block.d.ts +0 -20
  133. package/lib/components/menu/menu-divider/menu-divider.d.ts +0 -11
  134. package/lib/components/menu/menu-full-screen/menu-full-screen.d.ts +0 -16
  135. package/lib/components/menu/menu-item/menu-item.d.ts +0 -60
  136. package/lib/components/menu/menu-segment-title/menu-segment-title.d.ts +0 -12
  137. package/lib/components/menu/menu.d.ts +0 -28
  138. package/lib/components/menu/scrollable-block/scrollable-block.d.ts +0 -20
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { PaddingProps } from "styled-system";
3
+ import { MenuType } from "../menu.context";
4
+ import { MenuWithChildren } from "./menu-item.component";
5
+ interface StyledMenuItemWrapperProps extends Pick<MenuWithChildren, "href" | "variant" | "showDropdownArrow" | "overrideColor" | "clickToOpen" | "maxWidth">, PaddingProps {
6
+ menuType: MenuType;
7
+ selected?: boolean;
8
+ hasSubmenu?: boolean;
9
+ isOpen?: boolean;
10
+ inFullscreenView?: boolean;
11
+ asPassiveItem?: boolean;
12
+ placeholderTabIndex?: boolean;
13
+ icon?: string;
14
+ ariaLabel?: string;
15
+ asDiv?: boolean;
16
+ hasInput?: boolean;
17
+ }
18
+ declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"a", any, {
19
+ as: import("react").ForwardRefExoticComponent<import("../../link").LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
20
+ } & StyledMenuItemWrapperProps, "as">;
21
+ export default StyledMenuItemWrapper;
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
+ var _styledSystem = require("styled-system");
11
+
10
12
  var _link = require("../../link/link.style");
11
13
 
12
14
  var _icon = _interopRequireDefault(require("../../icon/icon.style"));
@@ -15,13 +17,19 @@ var _iconButton = _interopRequireDefault(require("../../icon-button/icon-button.
15
17
 
16
18
  var _menu = _interopRequireDefault(require("../menu.config"));
17
19
 
20
+ var _link2 = _interopRequireDefault(require("../../link"));
21
+
22
+ var _themes = require("../../../style/themes");
23
+
18
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
25
 
20
26
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
27
 
22
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; }
23
29
 
24
- const StyledMenuItemWrapper = _styledComponents.default.a`
30
+ const StyledMenuItemWrapper = _styledComponents.default.a.attrs({
31
+ as: _link2.default
32
+ })`
25
33
  ${({
26
34
  menuType,
27
35
  selected,
@@ -29,68 +37,81 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
29
37
  isOpen,
30
38
  variant,
31
39
  showDropdownArrow,
32
- isSearch,
33
40
  href,
34
41
  clickToOpen,
35
42
  maxWidth,
36
43
  inFullscreenView,
37
44
  overrideColor,
38
- as,
39
- asPassiveItem
45
+ asPassiveItem,
46
+ asDiv,
47
+ hasInput
40
48
  }) => (0, _styledComponents.css)`
49
+ ${_styledSystem.padding}
50
+
41
51
  display: inline-block;
42
52
  font-size: 14px;
43
53
  font-weight: 700;
44
54
  height: 40px;
45
55
  position: relative;
46
- cursor: pointer;
56
+ a,
57
+ button {
58
+ cursor: pointer;
59
+ }
47
60
  ${!overrideColor && (0, _styledComponents.css)`
48
- background-color: ${_menu.default[menuType].background};
49
- `}};
50
-
61
+ background-color: ${_menu.default[menuType].background};
62
+ `}
63
+
51
64
  ${overrideColor && (0, _styledComponents.css)`
52
- &&&& {
53
- background-color: ${variant === "alternate" ? _menu.default[menuType].alternate : _menu.default[menuType].submenuItemBackground};
54
- }
55
- `}
65
+ &&&& {
66
+ background-color: ${variant === "alternate" ? _menu.default[menuType].alternate : _menu.default[menuType].submenuItemBackground};
67
+ }
68
+ `}
56
69
 
57
70
  ${!inFullscreenView && (0, _styledComponents.css)`
58
- max-width: inherit;
59
-
60
- && {
61
- a,
62
- button {
63
- ${maxWidth && (0, _styledComponents.css)`
64
- box-sizing: border-box;
65
- max-width: inherit;
66
- text-overflow: ellipsis;
67
- overflow: hidden;
68
- white-space: nowrap;
69
- vertical-align: bottom;
70
- `}
71
- }
71
+ max-width: inherit;
72
72
 
73
- a:focus,
74
- button:focus {
75
- box-shadow: inset 0 0 0 var(--borderWidth300)
76
- var(--colorsSemanticFocus500);
77
- background-color: ${_menu.default[menuType].background};
78
- color: ${_menu.default[menuType].color};
79
- z-index: 1;
80
- position: relative;
81
- }
73
+ && {
74
+ a:focus,
75
+ button:focus {
76
+ box-shadow: inset 0 0 0 var(--borderWidth300)
77
+ var(--colorsSemanticFocus500);
78
+ background-color: ${_menu.default[menuType].background};
79
+ color: ${_menu.default[menuType].color};
80
+ z-index: 1;
81
+ position: relative;
82
+ }
83
+ }
84
+
85
+ &&& {
86
+ a,
87
+ button {
88
+ ${maxWidth && (0, _styledComponents.css)`
89
+ box-sizing: border-box;
90
+ max-width: inherit;
91
+ text-overflow: ellipsis;
92
+ overflow: hidden;
93
+ white-space: nowrap;
94
+ vertical-align: bottom;
95
+ `}
96
+ }
82
97
 
83
- a:hover,
84
- button:hover {
98
+ a:hover,
99
+ button:hover {
100
+ ${!asDiv && (0, _styledComponents.css)`
85
101
  background-color: var(--colorsComponentsMenuAutumnStandard600);
86
102
  color: var(--colorsComponentsMenuYang100);
87
103
 
88
104
  [data-component="icon"] {
89
105
  color: var(--colorsComponentsMenuYang100);
90
106
  }
107
+ `}
108
+
109
+ ::before {
110
+ border-top-color: var(--colorsComponentsMenuYang100);
91
111
  }
92
112
  }
93
- `}
113
+ }
114
+ `}
94
115
 
95
116
  ${asPassiveItem ? `
96
117
  ${_iconButton.default} {
@@ -123,7 +144,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
123
144
  text-align: left;
124
145
  }
125
146
 
126
- && {
147
+ &&& {
127
148
  a,
128
149
  button,
129
150
  [data-component="icon"],
@@ -132,7 +153,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
132
153
  ${_link.StyledLink} [data-component="icon"] {
133
154
  font-weight: 700;
134
155
  text-decoration: none;
135
- color: ${_menu.default[menuType].color};
156
+ ${!hasInput && `color: ${_menu.default[menuType].color};`}
136
157
  }
137
158
 
138
159
  ${_icon.default} {
@@ -141,123 +162,141 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
141
162
  }
142
163
 
143
164
  ${selected && (0, _styledComponents.css)`
144
- background-color: ${_menu.default[menuType].selected};
165
+ background-color: ${_menu.default[menuType].selected};
145
166
 
146
- a:focus,
147
- button:focus {
148
- background-color: ${_menu.default[menuType].selected};
149
- }
167
+ a:focus,
168
+ button:focus {
169
+ background-color: ${_menu.default[menuType].selected};
170
+ }
150
171
 
151
- a:hover,
152
- button:hover {
153
- background-color: var(--colorsComponentsMenuAutumnStandard600);
154
- }
155
- `}
172
+ a:hover,
173
+ button:hover {
174
+ background-color: var(--colorsComponentsMenuAutumnStandard600);
175
+ }
176
+ `}
156
177
 
157
178
  ${variant === "alternate" && !inFullscreenView && (0, _styledComponents.css)`
158
- &&& {
159
- background-color: ${_menu.default[menuType].alternate};
160
- }
179
+ &&& {
180
+ background-color: ${_menu.default[menuType].alternate};
181
+ }
161
182
 
162
- &&& a:focus,
163
- &&& button:focus {
164
- background-color: ${_menu.default[menuType].alternate};
165
- }
183
+ &&& a:focus,
184
+ &&& button:focus {
185
+ background-color: ${_menu.default[menuType].alternate};
186
+ }
166
187
 
188
+ ${!hasInput && (0, _styledComponents.css)`
167
189
  &&& a:hover,
168
190
  &&& button:hover {
169
191
  background-color: ${_menu.default[menuType].alternateHover};
170
192
  }
171
193
  `}
194
+ `}
172
195
 
173
196
  ${isOpen && (0, _styledComponents.css)`
174
- a,
175
- button {
176
- background-color: ${_menu.default[menuType].submenuItemBackground};
177
- color: ${_menu.default[menuType].color};
178
- }
179
- `}
180
-
197
+ a,
198
+ button {
199
+ background-color: ${_menu.default[menuType].submenuItemBackground};
200
+ color: ${_menu.default[menuType].color};
201
+ }
202
+ `}
203
+
181
204
  ${hasSubmenu && (0, _styledComponents.css)`
205
+ background-color: ${_menu.default[menuType].submenuBackground};
206
+
207
+ a:focus,
208
+ button:focus {
182
209
  background-color: ${_menu.default[menuType].submenuBackground};
210
+ color: ${_menu.default[menuType].color};
183
211
 
184
- a:focus,
185
- button:focus {
186
- background-color: ${_menu.default[menuType].submenuBackground};
212
+ [data-component="icon"] {
187
213
  color: ${_menu.default[menuType].color};
188
-
189
- [data-component="icon"] {
190
- color: ${_menu.default[menuType].color};
191
- }
192
-
193
- ${clickToOpen && isOpen && (0, _styledComponents.css)`
194
- background-color: ${_menu.default[menuType].submenuOpenedBackground};
195
- `}
196
214
  }
197
215
 
198
- a:hover,
199
- button:hover {
216
+ ${clickToOpen && isOpen && (0, _styledComponents.css)`
200
217
  background-color: ${_menu.default[menuType].submenuOpenedBackground};
201
- color: var(--colorsComponentsMenuYang100);
218
+ `}
219
+ }
202
220
 
203
- ${!(href || clickToOpen) && (0, _styledComponents.css)`
204
- cursor: default;
205
- background-color: ${_menu.default[menuType].submenuItemBackground};
206
- color: ${_menu.default[menuType].color};
207
- `}
221
+ a:hover,
222
+ button:hover {
223
+ background-color: ${_menu.default[menuType].submenuOpenedBackground};
224
+ color: var(--colorsComponentsMenuYang100);
208
225
 
209
- [data-component="icon"] {
210
- color: ${_menu.default[menuType].color};
211
- }
226
+ ${!(href || clickToOpen) && (0, _styledComponents.css)`
227
+ cursor: default;
228
+ background-color: ${_menu.default[menuType].submenuItemBackground};
229
+ color: ${_menu.default[menuType].color};
230
+ `}
231
+
232
+ [data-component="icon"] {
233
+ color: ${_menu.default[menuType].color};
212
234
  }
235
+ }
213
236
 
214
- ${selected && (0, _styledComponents.css)`
237
+ ${selected && (0, _styledComponents.css)`
238
+ background-color: ${_menu.default[menuType].submenuSelected};
239
+
240
+ a:focus,
241
+ button:focus {
215
242
  background-color: ${_menu.default[menuType].submenuSelected};
243
+ }
216
244
 
217
- a:focus,
218
- button:focus {
219
- background-color: ${_menu.default[menuType].submenuSelected};
220
- }
245
+ a:hover,
246
+ button:hover {
247
+ background-color: var(--colorsComponentsMenuAutumnStandard600);
248
+ color: var(--colorsComponentsMenuYang100);
249
+ }
250
+ `}
221
251
 
222
- a:hover,
223
- button:hover {
224
- background-color: var(--colorsComponentsMenuAutumnStandard600);
225
- color: var(--colorsComponentsMenuYang100);
226
- }
227
- `}
252
+ ${showDropdownArrow && (0, _styledComponents.css)`
253
+ > a,
254
+ > button:not(${_iconButton.default}) {
255
+ padding-right: 32px;
256
+ }
228
257
 
229
- ${showDropdownArrow && (0, _styledComponents.css)`
230
- > a,
231
- > button:not(${_iconButton.default}) {
232
- padding-right: 32px;
233
- }
258
+ a::before,
259
+ button::before {
260
+ display: block;
261
+ margin-top: -2px;
262
+ pointer-events: none;
263
+ position: absolute;
264
+ right: 16px;
265
+ top: 50%;
266
+ z-index: 2;
267
+ content: "";
268
+ width: 0;
269
+ height: 0;
270
+ border-width: 5px 4px 4px;
271
+ border-style: solid;
272
+ border-top-color: initial;
273
+ border-right-color: transparent;
274
+ border-bottom-color: transparent;
275
+ border-left-color: transparent;
276
+ }
277
+ `}
278
+ `}
234
279
 
235
- a::before,
236
- button::before {
237
- display: block;
238
- margin-top: -2px;
239
- pointer-events: none;
240
- position: absolute;
241
- right: 16px;
242
- top: 50%;
243
- z-index: 2;
244
- content: "";
245
- width: 0;
246
- height: 0;
247
- border-top: 5px solid ${_menu.default[menuType].text};
248
- border-right: 4px solid transparent;
249
- border-bottom: 4px solid transparent;
250
- border-left: 4px solid transparent;
280
+ ${inFullscreenView && (0, _styledComponents.css)`
281
+ ${asDiv && (0, _styledComponents.css)`
282
+ &&& {
283
+ > a,
284
+ > button {
285
+ color: ${_menu.default[menuType].title};
286
+ outline: none;
287
+ }
288
+
289
+ > button:hover,
290
+ > a:hover {
291
+ background-color: transparent;
292
+ cursor: default;
293
+ outline: none;
294
+ color: ${_menu.default[menuType].title};
295
+ }
251
296
  }
252
297
  `}
253
- `}
254
298
 
255
- ${isSearch && (0, _styledComponents.css)`
256
- padding: 2px 16px;
257
- `}
258
-
259
- ${inFullscreenView && (0, _styledComponents.css)`
260
- ${as === "div" && (0, _styledComponents.css)`
299
+ ${asPassiveItem && (0, _styledComponents.css)`
261
300
  cursor: default;
262
301
  padding: 0 16px;
263
302
 
@@ -266,35 +305,41 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
266
305
  }
267
306
  `}
268
307
 
269
- a,
308
+ a,
270
309
  ${_link.StyledLink} a,
271
310
  button,
272
311
  ${_link.StyledLink} button {
273
- width: 100vw;
274
- box-sizing: border-box;
275
- }
312
+ width: 100vw;
313
+ box-sizing: border-box;
314
+ }
276
315
 
277
- a:focus,
278
- button:focus {
279
- box-shadow: inset 0 0 0 var(--borderWidth300)
280
- var(--colorsSemanticFocus500);
281
- z-index: 1;
282
- position: relative;
283
- }
316
+ a:focus,
317
+ button:focus {
318
+ box-shadow: inset 0 0 0 var(--borderWidth300)
319
+ var(--colorsSemanticFocus500);
320
+ z-index: 1;
321
+ position: relative;
322
+ }
284
323
 
285
- a:focus,
286
- a:hover,
287
- button:focus,
288
- button:hover {
289
- background-color: var(--colorsComponentsMenuAutumnStandard600);
290
- color: var(--colorsComponentsMenuYang100);
324
+ a:focus,
325
+ a:hover,
326
+ button:focus,
327
+ button:hover {
328
+ background-color: var(--colorsComponentsMenuAutumnStandard600);
329
+ color: var(--colorsComponentsMenuYang100);
291
330
 
292
- [data-component="icon"] {
293
- color: var(--colorsComponentsMenuYang100);
294
- }
331
+ ${!hasInput && `
332
+ [data-component="icon"] {
333
+ color: var(--colorsComponentsMenuYang100);
334
+ }
335
+ `}
295
336
  }
296
- `}
337
+ }
338
+ `}
297
339
  `}
298
340
  `;
341
+ StyledMenuItemWrapper.defaultProps = {
342
+ theme: _themes.baseTheme
343
+ };
299
344
  var _default = StyledMenuItemWrapper;
300
345
  exports.default = _default;
@@ -1,2 +1,2 @@
1
- export { default } from "./menu-segment-title";
2
- export * from "./menu-segment-title";
1
+ export { default } from "./menu-segment-title.component";
2
+ export type { MenuTitleProps } from "./menu-segment-title.component";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _menuSegmentTitle.default;
10
+ }
11
+ });
12
+
13
+ var _menuSegmentTitle = _interopRequireDefault(require("./menu-segment-title.component"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { VariantType } from "../menu-item";
3
+ import { TagProps } from "../../../__internal__/utils/helpers/tags";
4
+ export interface MenuTitleProps extends TagProps {
5
+ children: string;
6
+ /** Set the colour variant for a menuType */
7
+ variant?: VariantType;
8
+ }
9
+ declare const MenuSegmentTitle: React.ForwardRefExoticComponent<MenuTitleProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default MenuSegmentTitle;
@@ -15,33 +15,38 @@ var _menu = _interopRequireDefault(require("../menu.context"));
15
15
 
16
16
  var _menu2 = require("../menu.style");
17
17
 
18
+ var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/tags"));
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
20
22
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
23
 
22
24
  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; }
23
25
 
26
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
+
24
28
  const MenuSegmentTitle = /*#__PURE__*/_react.default.forwardRef(({
25
29
  children,
26
- variant = "default"
30
+ variant = "default",
31
+ ...rest
27
32
  }, ref) => {
28
33
  const menuContext = (0, _react.useContext)(_menu.default);
29
34
  return /*#__PURE__*/_react.default.createElement(_menu2.StyledMenuItem, {
30
35
  inSubmenu: true
31
- }, /*#__PURE__*/_react.default.createElement(_menuSegmentTitle.default, {
32
- "data-component": "menu-segment-title",
36
+ }, /*#__PURE__*/_react.default.createElement(_menuSegmentTitle.default, _extends({}, (0, _tags.default)("menu-segment-title", rest), {
33
37
  menuType: menuContext.menuType,
34
38
  ref: ref,
35
39
  variant: variant
36
- }, children));
40
+ }), children));
37
41
  });
38
42
 
39
43
  MenuSegmentTitle.propTypes = {
40
- /** set the colour variant for a menuType */
41
- variant: _propTypes.default.oneOf(["default", "alternate"]),
42
-
43
- /** the text to be displayed */
44
- children: _propTypes.default.string.isRequired
44
+ "children": _propTypes.default.string.isRequired,
45
+ "data-component": _propTypes.default.string,
46
+ "data-element": _propTypes.default.string,
47
+ "data-role": _propTypes.default.string,
48
+ "variant": _propTypes.default.oneOf(["alternate", "default"])
45
49
  };
50
+ MenuSegmentTitle.displayName = "MenuSegmentTitle";
46
51
  var _default = MenuSegmentTitle;
47
52
  exports.default = _default;
@@ -0,0 +1,8 @@
1
+ import { VariantType } from "../menu-item";
2
+ import { MenuType } from "../menu.context";
3
+ interface StyledTitleProps {
4
+ variant?: VariantType;
5
+ menuType: MenuType;
6
+ }
7
+ declare const StyledTitle: import("styled-components").StyledComponent<"div", any, StyledTitleProps, never>;
8
+ export default StyledTitle;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../../../../esm/components/menu/menu-segment-title/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -1,11 +1,13 @@
1
+ import React from "react";
2
+ import { LayoutProps, FlexboxProps } from "styled-system";
3
+ import { TagProps } from "../../__internal__/utils/helpers/tags";
4
+ import MenuContext, { MenuType } from "./menu.context";
5
+ export interface MenuProps extends TagProps, LayoutProps, FlexboxProps {
6
+ /** Children elements */
7
+ children: React.ReactNode;
8
+ /** Defines the color scheme of the component */
9
+ menuType?: MenuType;
10
+ }
11
+ export declare const Menu: ({ menuType, children, ...rest }: MenuProps) => JSX.Element;
1
12
  export { MenuContext };
2
13
  export default Menu;
3
- import MenuContext from "./menu.context";
4
- declare function Menu({ menuType, children, ...rest }: {
5
- [x: string]: any;
6
- menuType?: string | undefined;
7
- children: any;
8
- }): JSX.Element;
9
- declare namespace Menu {
10
- const propTypes: any;
11
- }