carbon-react 102.11.0 → 102.13.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/lib/__internal__/input/input-presentation.style.js +3 -2
- package/lib/components/checkbox/checkbox.style.js +5 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -0
- package/lib/components/menu/__internal__/submenu/submenu.style.js +8 -40
- package/lib/components/menu/menu-divider/menu-divider.style.js +1 -1
- package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +14 -2
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +2 -10
- package/lib/components/menu/menu-item/menu-item.style.js +26 -92
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +2 -10
- package/lib/components/menu/menu.component.js +1 -1
- package/lib/components/menu/menu.context.d.ts +3 -1
- package/lib/components/menu/menu.context.js +3 -1
- package/lib/components/menu/menu.d.ts +3 -2
- package/lib/components/menu/menu.style.js +1 -2
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +7 -1
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -7
- package/lib/components/menu/submenu-block/submenu-block.style.js +4 -6
- package/lib/components/navigation-bar/navigation-bar.component.js +1 -1
- package/lib/components/navigation-bar/navigation-bar.d.ts +1 -1
- package/lib/components/navigation-bar/navigation-bar.style.js +15 -2
- package/lib/style/color-config/index.js +2 -1
- package/lib/style/themes/base/base-theme.config.d.ts +36 -0
- package/lib/style/themes/base/base-theme.config.js +37 -1
- package/package.json +1 -1
|
@@ -60,8 +60,9 @@ const InputPresentationStyle = _styledComponents.default.div`
|
|
|
60
60
|
|
|
61
61
|
${({
|
|
62
62
|
hasFocus,
|
|
63
|
-
theme
|
|
64
|
-
|
|
63
|
+
theme,
|
|
64
|
+
disabled
|
|
65
|
+
}) => hasFocus && !disabled && (0, _styledComponents.css)`
|
|
65
66
|
&& {
|
|
66
67
|
outline: 3px solid ${theme.colors.focus};
|
|
67
68
|
z-index: 2;
|
|
@@ -228,7 +228,11 @@ const StyledCheckboxGroup = _styledComponents.default.div`
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
& ${CheckboxStyle} {
|
|
231
|
-
|
|
231
|
+
margin-bottom: var(--spacing150);
|
|
232
|
+
|
|
233
|
+
:last-of-type {
|
|
234
|
+
margin-bottom: 0;
|
|
235
|
+
}
|
|
232
236
|
}
|
|
233
237
|
|
|
234
238
|
& > ${_formField.default} {
|
|
@@ -95,6 +95,7 @@ const DialogFullScreen = ({
|
|
|
95
95
|
focusFirstElement: focusFirstElement,
|
|
96
96
|
wrapperRef: dialogRef
|
|
97
97
|
}, /*#__PURE__*/_react.default.createElement(_dialogFullScreen.default, {
|
|
98
|
+
"aria-modal": true,
|
|
98
99
|
"aria-describedby": ariaDescribedBy,
|
|
99
100
|
"aria-label": ariaLabel,
|
|
100
101
|
"aria-labelledby": ariaLabelledBy || "carbon-dialog-title",
|
|
@@ -47,7 +47,7 @@ const StyledSubmenuWrapper = _styledComponents.default.div`
|
|
|
47
47
|
}) => inFullscreenView && asPassiveItem && (0, _styledComponents.css)`
|
|
48
48
|
${_menuItem.default} {
|
|
49
49
|
outline: none;
|
|
50
|
-
color: ${
|
|
50
|
+
color: ${theme.menu[menuType].title};
|
|
51
51
|
}
|
|
52
52
|
`}
|
|
53
53
|
`;
|
|
@@ -64,8 +64,7 @@ const StyledSubmenu = _styledComponents.default.ul`
|
|
|
64
64
|
box-shadow: 0 5px 5px 0 rgba(0, 20, 29, 0.2),
|
|
65
65
|
0 10px 10px 0 rgba(0, 20, 29, 0.1);
|
|
66
66
|
position: absolute;
|
|
67
|
-
background
|
|
68
|
-
|
|
67
|
+
background: ${variant === "default" ? theme.menu[menuType].submenuBackground : theme.menu[menuType].background};
|
|
69
68
|
a,
|
|
70
69
|
button,
|
|
71
70
|
${_link.StyledLink} a,
|
|
@@ -109,10 +108,7 @@ const StyledSubmenu = _styledComponents.default.ul`
|
|
|
109
108
|
white-space: nowrap;
|
|
110
109
|
cursor: pointer;
|
|
111
110
|
|
|
112
|
-
${
|
|
113
|
-
${!inFullscreenView && `background-color: ${theme.colors.white};`}
|
|
114
|
-
color: ${theme.colors.black};
|
|
115
|
-
`}
|
|
111
|
+
${!inFullscreenView && `background-color: ${theme.menu[menuType].submenuBackground};`}
|
|
116
112
|
|
|
117
113
|
&:hover,
|
|
118
114
|
&:hover a,
|
|
@@ -129,43 +125,15 @@ const StyledSubmenu = _styledComponents.default.ul`
|
|
|
129
125
|
height: 16px;
|
|
130
126
|
margin-right: 5px;
|
|
131
127
|
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
${menuType === "dark" && (0, _styledComponents.css)`
|
|
135
|
-
background: ${variant === "default" ? theme.menu.dark.submenuBackground : theme.colors.slate};
|
|
136
128
|
|
|
137
|
-
${
|
|
138
|
-
|
|
139
|
-
color: ${theme.colors.white};
|
|
129
|
+
${_search.default} [data-component="icon"] {
|
|
130
|
+
color: ${theme.menu[menuType].searchIcon};
|
|
140
131
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
[data-component="icon"] {
|
|
144
|
-
color: ${theme.colors.white};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.carbon-menu-item--has-link button {
|
|
148
|
-
color: ${theme.colors.white};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
${_search.default} [data-component="icon"] {
|
|
152
|
-
color: ${theme.menu.dark.searchIcon};
|
|
153
|
-
|
|
154
|
-
&:hover {
|
|
155
|
-
color: ${theme.menu.dark.searchIconHover};
|
|
156
|
-
}
|
|
132
|
+
&:hover {
|
|
133
|
+
color: ${theme.menu[menuType].searchIconHover};
|
|
157
134
|
}
|
|
158
135
|
}
|
|
159
|
-
|
|
160
|
-
.carbon-menu-item--has-link:hover {
|
|
161
|
-
background-color: ${theme.colors.primary};
|
|
162
|
-
text-decoration: none;
|
|
163
|
-
|
|
164
|
-
[data-component="icon"] {
|
|
165
|
-
color: ${theme.colors.white};
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
`}
|
|
136
|
+
}
|
|
169
137
|
|
|
170
138
|
[data-component="icon"] {
|
|
171
139
|
line-height: 16px;
|
|
@@ -22,7 +22,7 @@ const StyledDivider = _styledComponents.default.div`
|
|
|
22
22
|
}) => (0, _styledComponents.css)`
|
|
23
23
|
margin: 0px ${size === "large" ? "" : "16px"};
|
|
24
24
|
height: ${size === "large" ? "4px" : "1px"};
|
|
25
|
-
background: ${
|
|
25
|
+
background: ${theme.menu[menuType].divider};
|
|
26
26
|
`}
|
|
27
27
|
`;
|
|
28
28
|
StyledDivider.defaultProps = {
|
|
@@ -70,6 +70,18 @@ const MenuFullscreen = ({
|
|
|
70
70
|
wrapperRef.removeEventListener("transitionend", checkTransitionEnd);
|
|
71
71
|
}
|
|
72
72
|
}, [isOpen]);
|
|
73
|
+
const scrollVariants = {
|
|
74
|
+
light: "light",
|
|
75
|
+
dark: "dark",
|
|
76
|
+
white: "light",
|
|
77
|
+
black: "dark"
|
|
78
|
+
};
|
|
79
|
+
const iconColors = {
|
|
80
|
+
light: undefined,
|
|
81
|
+
dark: "#FFFFFF",
|
|
82
|
+
white: undefined,
|
|
83
|
+
black: "#FFFFFF"
|
|
84
|
+
};
|
|
73
85
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
74
86
|
"aria-label": "menu-fullscreen"
|
|
75
87
|
}, /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_focusTrap.default, {
|
|
@@ -92,10 +104,10 @@ const MenuFullscreen = ({
|
|
|
92
104
|
"data-element": "close"
|
|
93
105
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
94
106
|
type: "close",
|
|
95
|
-
color: menuType
|
|
107
|
+
color: iconColors[menuType]
|
|
96
108
|
}))), /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
97
109
|
overflow: "auto",
|
|
98
|
-
scrollVariant: menuType,
|
|
110
|
+
scrollVariant: scrollVariants[menuType],
|
|
99
111
|
width: "100vw",
|
|
100
112
|
height: "100vh"
|
|
101
113
|
}, /*#__PURE__*/_react.default.createElement(_menu.StyledMenuWrapper, {
|
|
@@ -36,13 +36,9 @@ const StyledMenuFullscreen = _styledComponents.default.div`
|
|
|
36
36
|
startPosition,
|
|
37
37
|
theme
|
|
38
38
|
}) => (0, _styledComponents.css)`
|
|
39
|
-
background-color: ${theme.menu.
|
|
39
|
+
background-color: ${theme.menu[menuType].background};
|
|
40
40
|
z-index: ${theme.zIndex.fullScreenModal};
|
|
41
41
|
|
|
42
|
-
${menuType === "dark" && (0, _styledComponents.css)`
|
|
43
|
-
background-color: ${theme.colors.slate};
|
|
44
|
-
`}
|
|
45
|
-
|
|
46
42
|
${isOpen && (0, _styledComponents.css)`
|
|
47
43
|
visibility: visible;
|
|
48
44
|
${startPosition}: 0;
|
|
@@ -77,11 +73,7 @@ const StyledMenuFullscreenHeader = _styledComponents.default.div`
|
|
|
77
73
|
menuType,
|
|
78
74
|
theme
|
|
79
75
|
}) => (0, _styledComponents.css)`
|
|
80
|
-
background-color: ${theme.
|
|
81
|
-
|
|
82
|
-
${menuType === "dark" && (0, _styledComponents.css)`
|
|
83
|
-
background-color: ${theme.menu.dark.submenuBackground};
|
|
84
|
-
`}
|
|
76
|
+
background-color: ${theme.menu[menuType].submenuBackground};
|
|
85
77
|
`}
|
|
86
78
|
`;
|
|
87
79
|
exports.StyledMenuFullscreenHeader = StyledMenuFullscreenHeader;
|
|
@@ -41,7 +41,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
41
41
|
height: 40px;
|
|
42
42
|
position: relative;
|
|
43
43
|
cursor: pointer;
|
|
44
|
-
background-color: ${theme.menu.
|
|
44
|
+
background-color: ${theme.menu[menuType].background};
|
|
45
45
|
|
|
46
46
|
${!inFullscreenView && (0, _styledComponents.css)`
|
|
47
47
|
max-width: inherit;
|
|
@@ -96,7 +96,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
96
96
|
${_link.StyledLink} [data-component="icon"] {
|
|
97
97
|
font-weight: 700;
|
|
98
98
|
text-decoration: none;
|
|
99
|
-
color: ${theme.
|
|
99
|
+
color: ${theme.menu[menuType].text};
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
a:hover,
|
|
@@ -134,77 +134,19 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
134
134
|
|
|
135
135
|
${variant === "alternate" && (0, _styledComponents.css)`
|
|
136
136
|
&&& {
|
|
137
|
-
background-color: ${theme.menu.
|
|
137
|
+
background-color: ${theme.menu[menuType].alternate};
|
|
138
138
|
}
|
|
139
139
|
`}
|
|
140
140
|
|
|
141
141
|
${selected && (0, _styledComponents.css)`
|
|
142
|
-
background-color: ${theme.menu.
|
|
142
|
+
background-color: ${theme.menu[menuType].selected};
|
|
143
143
|
`}
|
|
144
144
|
|
|
145
|
-
${
|
|
146
|
-
background-color: ${theme.
|
|
145
|
+
${isOpen && (0, _styledComponents.css)`
|
|
146
|
+
background-color: ${theme.menu[menuType].submenuBackground};
|
|
147
147
|
color: ${theme.colors.white};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
a:hover,
|
|
151
|
-
a:focus,
|
|
152
|
-
button,
|
|
153
|
-
button:hover,
|
|
154
|
-
[data-component="icon"],
|
|
155
|
-
${_link.StyledLink} [data-component="icon"] {
|
|
156
|
-
font-weight: 700;
|
|
157
|
-
text-decoration: none;
|
|
158
|
-
color: ${theme.colors.white};
|
|
159
|
-
background-color: transparent;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
${selected && (0, _styledComponents.css)`
|
|
163
|
-
background-color: ${theme.menu.dark.selected};
|
|
164
|
-
`}
|
|
165
|
-
|
|
166
|
-
[data-component='icon'] {
|
|
167
|
-
color: ${theme.colors.white};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
${hasSubmenu && (0, _styledComponents.css)`
|
|
171
|
-
${!href && (0, _styledComponents.css)`
|
|
172
|
-
&& a:hover,
|
|
173
|
-
&& button:hover {
|
|
174
|
-
background-color: ${theme.menu.dark.submenuBackground};
|
|
175
|
-
color: ${theme.colors.white};
|
|
176
|
-
|
|
177
|
-
[data-component="icon"] {
|
|
178
|
-
color: ${theme.colors.white};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&& a:focus,
|
|
183
|
-
&& button:focus {
|
|
184
|
-
background-color: ${theme.menu.dark.submenuBackground};
|
|
185
|
-
color: ${theme.colors.white};
|
|
186
|
-
|
|
187
|
-
a,
|
|
188
|
-
button,
|
|
189
|
-
[data-component="icon"] {
|
|
190
|
-
color: ${theme.colors.white};
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
`}
|
|
194
|
-
|
|
195
|
-
${isOpen && (0, _styledComponents.css)`
|
|
196
|
-
background-color: ${theme.menu.dark.submenuBackground};
|
|
197
|
-
color: ${theme.colors.white};
|
|
198
|
-
`}
|
|
199
|
-
`}
|
|
200
|
-
|
|
201
|
-
${variant === "alternate" && (0, _styledComponents.css)`
|
|
202
|
-
&&& {
|
|
203
|
-
background-color: ${theme.colors.slate};
|
|
204
|
-
}
|
|
205
|
-
`}
|
|
206
|
-
`}
|
|
207
|
-
|
|
148
|
+
`}
|
|
149
|
+
|
|
208
150
|
${hasSubmenu && (0, _styledComponents.css)`
|
|
209
151
|
a:hover,
|
|
210
152
|
button:hover {
|
|
@@ -213,35 +155,28 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
213
155
|
`}
|
|
214
156
|
}
|
|
215
157
|
|
|
216
|
-
${
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
color: ${theme.colors.black};
|
|
158
|
+
${!href && (0, _styledComponents.css)`
|
|
159
|
+
&& a:hover,
|
|
160
|
+
&& button:hover {
|
|
161
|
+
background-color: ${theme.menu[menuType].submenuBackground};
|
|
162
|
+
color: ${theme.menu[menuType].text};
|
|
222
163
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
164
|
+
[data-component="icon"] {
|
|
165
|
+
color: ${theme.menu[menuType].text};
|
|
226
166
|
}
|
|
167
|
+
}
|
|
227
168
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
169
|
+
&& a:focus,
|
|
170
|
+
&& button:focus {
|
|
171
|
+
background-color: ${theme.menu[menuType].submenuBackground};
|
|
172
|
+
color: ${theme.menu[menuType].text};
|
|
232
173
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
174
|
+
a,
|
|
175
|
+
button,
|
|
176
|
+
[data-component="icon"] {
|
|
177
|
+
color: ${theme.menu[menuType].text};
|
|
238
178
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
${isOpen && (0, _styledComponents.css)`
|
|
242
|
-
background-color: ${theme.colors.white};
|
|
243
|
-
color: ${theme.colors.black};
|
|
244
|
-
`}
|
|
179
|
+
}
|
|
245
180
|
`}
|
|
246
181
|
|
|
247
182
|
${showDropdownArrow && (0, _styledComponents.css)`
|
|
@@ -269,8 +204,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
269
204
|
content: "";
|
|
270
205
|
width: 0;
|
|
271
206
|
height: 0;
|
|
272
|
-
border-top: 5px solid
|
|
273
|
-
${menuType !== "dark" ? theme.colors.slate : theme.colors.white};
|
|
207
|
+
border-top: 5px solid ${theme.menu[menuType].text};
|
|
274
208
|
border-right: 4px solid transparent;
|
|
275
209
|
border-bottom: 4px solid transparent;
|
|
276
210
|
border-left: 4px solid transparent;
|
|
@@ -25,16 +25,8 @@ const StyledTitle = _styledComponents.default.div`
|
|
|
25
25
|
text-transform: uppercase;
|
|
26
26
|
line-height: 12px;
|
|
27
27
|
cursor: default;
|
|
28
|
-
|
|
29
|
-
${
|
|
30
|
-
${variant === "alternate" ? `background: ${theme.menu.light.background};` : ""}
|
|
31
|
-
color: ${theme.menu.light.title};
|
|
32
|
-
`}
|
|
33
|
-
|
|
34
|
-
${menuType === "dark" && (0, _styledComponents.css)`
|
|
35
|
-
${variant === "alternate" ? `background: ${theme.colors.slate};` : ""}
|
|
36
|
-
color: ${theme.menu.dark.title};
|
|
37
|
-
`}
|
|
28
|
+
color: ${theme.menu[menuType].title};
|
|
29
|
+
${variant === "alternate" ? `background: ${theme.menu[menuType].alternate};` : ""};
|
|
38
30
|
`}
|
|
39
31
|
`;
|
|
40
32
|
StyledTitle.defaultProps = {
|
|
@@ -82,7 +82,7 @@ Menu.propTypes = {
|
|
|
82
82
|
..._propTypes2.default.layout,
|
|
83
83
|
|
|
84
84
|
/** Defines the color scheme of the component */
|
|
85
|
-
menuType: _propTypes.default.oneOf(["light", "dark"]),
|
|
85
|
+
menuType: _propTypes.default.oneOf(["light", "dark", "white", "black"]),
|
|
86
86
|
|
|
87
87
|
/** Children elements */
|
|
88
88
|
children: _propTypes.default.node.isRequired
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
var _default = /*#__PURE__*/_react.default.createContext({
|
|
12
|
+
var _default = /*#__PURE__*/_react.default.createContext({
|
|
13
|
+
menuType: "light"
|
|
14
|
+
});
|
|
13
15
|
|
|
14
16
|
exports.default = _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { LayoutProps, FlexBoxProps } from "../../utils/helpers/options-helper";
|
|
3
3
|
|
|
4
|
+
type menuType = "light" | "dark" | "white" | "black";
|
|
4
5
|
interface MenuContextProps {
|
|
5
|
-
menuType:
|
|
6
|
+
menuType: menuType;
|
|
6
7
|
isFirstElement: boolean;
|
|
7
8
|
handleKeyDown: (ev, submenuOpen) => void;
|
|
8
9
|
isFocused: boolean;
|
|
@@ -13,7 +14,7 @@ export interface MenuProps extends LayoutProps, FlexBoxProps {
|
|
|
13
14
|
/** Children elements */
|
|
14
15
|
children: React.ReactNode;
|
|
15
16
|
/** Defines the color scheme of the component */
|
|
16
|
-
menuType?:
|
|
17
|
+
menuType?: menuType;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
declare const MenuContext: React.Context<MenuContextProps>;
|
|
@@ -32,12 +32,11 @@ const StyledMenuWrapper = _styledComponents.default.ul`
|
|
|
32
32
|
menuType,
|
|
33
33
|
theme
|
|
34
34
|
}) => (0, _styledComponents.css)`
|
|
35
|
-
background-color: ${theme.menu.light.background};
|
|
36
35
|
display: inline-block;
|
|
37
36
|
vertical-align: bottom;
|
|
37
|
+
background-color: ${theme.menu[menuType].background};
|
|
38
38
|
|
|
39
39
|
${menuType === "dark" && (0, _styledComponents.css)`
|
|
40
|
-
background-color: ${theme.colors.slate};
|
|
41
40
|
color: ${theme.colors.white};
|
|
42
41
|
`}
|
|
43
42
|
`}
|
|
@@ -38,13 +38,19 @@ const ScrollableBlock = ({
|
|
|
38
38
|
focusIndex,
|
|
39
39
|
handleKeyDown
|
|
40
40
|
} = submenuContext;
|
|
41
|
+
const scrollVariants = {
|
|
42
|
+
light: "light",
|
|
43
|
+
dark: "dark",
|
|
44
|
+
white: "light",
|
|
45
|
+
black: "dark"
|
|
46
|
+
};
|
|
41
47
|
return /*#__PURE__*/_react.default.createElement(_scrollableBlock.default, _extends({
|
|
42
48
|
"data-component": "submenu-scrollable-block",
|
|
43
49
|
menuType: menuContext.menuType,
|
|
44
50
|
variant: variant
|
|
45
51
|
}, rest), /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
46
52
|
overflowY: "scroll",
|
|
47
|
-
scrollVariant: menuContext.menuType,
|
|
53
|
+
scrollVariant: scrollVariants[menuContext.menuType],
|
|
48
54
|
height: height,
|
|
49
55
|
p: 0
|
|
50
56
|
}, _react.default.Children.map(children, (child, index) => {
|
|
@@ -24,14 +24,8 @@ const StyledScrollableBlock = _styledComponents.default.div`
|
|
|
24
24
|
theme
|
|
25
25
|
}) => (0, _styledComponents.css)`
|
|
26
26
|
&& ${_menuItem.default} {
|
|
27
|
-
background-color: ${variant === "default" ? theme.
|
|
27
|
+
background-color: ${variant === "default" ? theme.menu[menuType].submenuBackground : theme.menu[menuType].background};
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
${menuType === "dark" && (0, _styledComponents.css)`
|
|
31
|
-
&& ${_menuItem.default} {
|
|
32
|
-
background-color: ${variant === "default" ? theme.menu.dark.submenuBackground : theme.colors.slate};
|
|
33
|
-
}
|
|
34
|
-
`}
|
|
35
29
|
`}
|
|
36
30
|
`;
|
|
37
31
|
StyledScrollableBlock.defaultProps = {
|
|
@@ -23,13 +23,11 @@ const StyledSubmenuBlock = _styledComponents.default.div`
|
|
|
23
23
|
theme,
|
|
24
24
|
variant
|
|
25
25
|
}) => (0, _styledComponents.css)`
|
|
26
|
-
${menuType
|
|
27
|
-
background-color: ${theme.menu.dark.submenuBackground};
|
|
26
|
+
background-color: ${theme.menu[menuType].submenuBackground};
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`}
|
|
28
|
+
${_menuItem.default} {
|
|
29
|
+
background-color: ${variant === "default" ? "transparent" : theme.menu[menuType].alternate};
|
|
30
|
+
}
|
|
33
31
|
`}
|
|
34
32
|
`;
|
|
35
33
|
StyledSubmenuBlock.defaultProps = {
|
|
@@ -46,7 +46,7 @@ NavigationBar.propTypes = {
|
|
|
46
46
|
ariaLabel: _propTypes.default.string,
|
|
47
47
|
|
|
48
48
|
/** Color scheme of navigation component */
|
|
49
|
-
navigationType: _propTypes.default.oneOf(["light", "dark"]),
|
|
49
|
+
navigationType: _propTypes.default.oneOf(["light", "dark", "white", "black"]),
|
|
50
50
|
|
|
51
51
|
/** If 'true' the children will not be visible */
|
|
52
52
|
isLoading: _propTypes.default.bool,
|
|
@@ -4,7 +4,7 @@ import { SpaceProps } from "styled-system";
|
|
|
4
4
|
export interface NavigationBarProps extends SpaceProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
ariaLabel?: string;
|
|
7
|
-
navigationType?: "light" | "dark";
|
|
7
|
+
navigationType?: "light" | "dark" | "white" | "black";
|
|
8
8
|
isLoading?: boolean;
|
|
9
9
|
stickyPosition?: "top" | "bottom";
|
|
10
10
|
stickyOffset?: string;
|
|
@@ -62,14 +62,27 @@ const StyledNavigationBar = _styledComponents.default.nav`
|
|
|
62
62
|
theme
|
|
63
63
|
}) => (0, _styledComponents.css)`
|
|
64
64
|
min-height: 40px;
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
|
|
66
|
+
${navigationType === "light" && (0, _styledComponents.css)`
|
|
67
|
+
background-color: ${theme.navigationBar.light.background};
|
|
68
|
+
border-bottom: 1px solid ${theme.navigationBar.light.borderBottom};
|
|
69
|
+
`}
|
|
67
70
|
|
|
68
71
|
${navigationType === "dark" && (0, _styledComponents.css)`
|
|
69
72
|
background-color: ${theme.navigationBar.dark.background};
|
|
70
73
|
border-bottom: 1px solid ${theme.navigationBar.dark.borderBottom};
|
|
71
74
|
color: ${theme.colors.white};
|
|
72
75
|
`}
|
|
76
|
+
|
|
77
|
+
${navigationType === "black" && (0, _styledComponents.css)`
|
|
78
|
+
background-color: ${theme.navigationBar.black.background};
|
|
79
|
+
color: ${theme.colors.white};
|
|
80
|
+
`}
|
|
81
|
+
|
|
82
|
+
${navigationType === "white" && (0, _styledComponents.css)`
|
|
83
|
+
background-color: ${theme.colors.white};
|
|
84
|
+
border-bottom: 1px solid ${theme.navigationBar.white.borderBottom};
|
|
85
|
+
`}
|
|
73
86
|
`}
|
|
74
87
|
`;
|
|
75
88
|
StyledNavigationBar.defaultProps = {
|
|
@@ -77,15 +77,45 @@ declare function _default(palette: any): {
|
|
|
77
77
|
itemColor: any;
|
|
78
78
|
itemColorDisabled: any;
|
|
79
79
|
light: {
|
|
80
|
+
text: string;
|
|
80
81
|
background: any;
|
|
81
82
|
selected: any;
|
|
82
83
|
divider: any;
|
|
84
|
+
alternate: any;
|
|
83
85
|
title: any;
|
|
86
|
+
submenuBackground: string;
|
|
87
|
+
searchIcon: any;
|
|
88
|
+
searchIconHover: any;
|
|
84
89
|
};
|
|
85
90
|
dark: {
|
|
91
|
+
text: string;
|
|
92
|
+
background: any;
|
|
86
93
|
divider: any;
|
|
87
94
|
submenuBackground: any;
|
|
88
95
|
selected: any;
|
|
96
|
+
alternate: any;
|
|
97
|
+
title: any;
|
|
98
|
+
searchIcon: any;
|
|
99
|
+
searchIconHover: any;
|
|
100
|
+
};
|
|
101
|
+
black: {
|
|
102
|
+
text: string;
|
|
103
|
+
background: any;
|
|
104
|
+
submenuBackground: any;
|
|
105
|
+
selected: any;
|
|
106
|
+
divider: any;
|
|
107
|
+
alternate: any;
|
|
108
|
+
title: any;
|
|
109
|
+
searchIcon: any;
|
|
110
|
+
searchIconHover: any;
|
|
111
|
+
};
|
|
112
|
+
white: {
|
|
113
|
+
text: string;
|
|
114
|
+
background: string;
|
|
115
|
+
selected: any;
|
|
116
|
+
divider: any;
|
|
117
|
+
alternate: any;
|
|
118
|
+
submenuBackground: any;
|
|
89
119
|
title: any;
|
|
90
120
|
searchIcon: any;
|
|
91
121
|
searchIconHover: any;
|
|
@@ -220,6 +250,12 @@ declare function _default(palette: any): {
|
|
|
220
250
|
background: string;
|
|
221
251
|
borderBottom: string;
|
|
222
252
|
};
|
|
253
|
+
black: {
|
|
254
|
+
background: any;
|
|
255
|
+
};
|
|
256
|
+
white: {
|
|
257
|
+
borderBottom: any;
|
|
258
|
+
};
|
|
223
259
|
};
|
|
224
260
|
numeralDate: {
|
|
225
261
|
passive: string;
|
|
@@ -96,18 +96,48 @@ var _default = palette => {
|
|
|
96
96
|
itemColor: palette.blackOpacity(0.9),
|
|
97
97
|
itemColorDisabled: palette.blackOpacity(0.3),
|
|
98
98
|
light: {
|
|
99
|
+
text: "#000000",
|
|
99
100
|
background: palette.slateTint(90),
|
|
100
101
|
selected: palette.slateTint(85),
|
|
101
102
|
divider: palette.slateTint(80),
|
|
102
|
-
|
|
103
|
+
alternate: palette.slateTint(90),
|
|
104
|
+
title: palette.slateTint(25),
|
|
105
|
+
submenuBackground: "#FFFFFF",
|
|
106
|
+
searchIcon: palette.slateTint(55),
|
|
107
|
+
searchIconHover: palette.slateTint(75)
|
|
103
108
|
},
|
|
104
109
|
dark: {
|
|
110
|
+
text: "#FFFFFF",
|
|
111
|
+
background: palette.slate,
|
|
105
112
|
divider: palette.slateTint(10),
|
|
106
113
|
submenuBackground: palette.slateShade(50),
|
|
107
114
|
selected: palette.slateTint(10),
|
|
115
|
+
alternate: palette.slate,
|
|
116
|
+
title: palette.slateTint(60),
|
|
117
|
+
searchIcon: palette.slateTint(55),
|
|
118
|
+
searchIconHover: palette.slateTint(75)
|
|
119
|
+
},
|
|
120
|
+
black: {
|
|
121
|
+
text: "#FFFFFF",
|
|
122
|
+
background: palette.black,
|
|
123
|
+
submenuBackground: palette.black,
|
|
124
|
+
selected: palette.blackTint(15),
|
|
125
|
+
divider: palette.blackTint(15),
|
|
126
|
+
alternate: palette.blackTint(10),
|
|
108
127
|
title: palette.slateTint(60),
|
|
109
128
|
searchIcon: palette.slateTint(55),
|
|
110
129
|
searchIconHover: palette.slateTint(75)
|
|
130
|
+
},
|
|
131
|
+
white: {
|
|
132
|
+
text: "#000000",
|
|
133
|
+
background: "#FFFFFF",
|
|
134
|
+
selected: palette.slateTint(95),
|
|
135
|
+
divider: palette.slateTint(70),
|
|
136
|
+
alternate: palette.slateTint(80),
|
|
137
|
+
submenuBackground: palette.slateTint(90),
|
|
138
|
+
title: palette.slateTint(25),
|
|
139
|
+
searchIcon: palette.slateTint(55),
|
|
140
|
+
searchIconHover: palette.slateTint(75)
|
|
111
141
|
}
|
|
112
142
|
},
|
|
113
143
|
form: {
|
|
@@ -238,6 +268,12 @@ var _default = palette => {
|
|
|
238
268
|
dark: {
|
|
239
269
|
background: "#003349",
|
|
240
270
|
borderBottom: "#003349"
|
|
271
|
+
},
|
|
272
|
+
black: {
|
|
273
|
+
background: palette.blackOpacity(1)
|
|
274
|
+
},
|
|
275
|
+
white: {
|
|
276
|
+
borderBottom: palette.slateTint(85)
|
|
241
277
|
}
|
|
242
278
|
},
|
|
243
279
|
numeralDate: {
|