orcs-design-system 3.2.4 → 3.2.6

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 (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. package/package.json +29 -38
@@ -1,4 +1,3 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
1
  import React, { useState, useEffect, useRef } from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import styled, { ThemeProvider } from "styled-components";
@@ -13,36 +12,31 @@ import StyledLink from "../StyledLink/";
13
12
  import { css } from "@styled-system/css";
14
13
  import shouldForwardProp from "@styled-system/should-forward-prop";
15
14
  import { themeGet } from "@styled-system/theme-get";
16
- var Bar = styled("header").withConfig({
17
- shouldForwardProp: shouldForwardProp,
15
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
16
+ const Bar = styled("header").withConfig({
17
+ shouldForwardProp,
18
18
  displayName: "Header__Bar",
19
19
  componentId: "sc-yf04b-0"
20
- }).attrs(function (props) {
21
- return {
22
- "data-testid": props.dataTestId
23
- };
24
- })(function (props) {
25
- return {
26
- height: themeGet("appScale.navBarSize")(props)
27
- };
28
- }, function (props) {
29
- return css({
30
- width: "100%",
31
- zIndex: 12,
32
- position: "sticky",
33
- top: "0",
34
- display: "flex",
35
- alignItems: "center",
36
- py: 0,
37
- px: 4,
38
- bg: themeGet("colors.black")(props),
39
- "a[class^='StyledLink'], a[class*=' StyledLink'], div[class^='Badge'], div[class*=' Badge']": {
40
- display: ["none", "none", "none", "block", "block"]
41
- }
42
- });
43
- }, variant({
20
+ }).attrs(props => ({
21
+ "data-testid": props.dataTestId
22
+ }))(props => ({
23
+ height: themeGet("appScale.navBarSize")(props)
24
+ }), props => css({
25
+ width: "100%",
26
+ zIndex: 12,
27
+ position: "sticky",
28
+ top: "0",
29
+ display: "flex",
30
+ alignItems: "center",
31
+ py: 0,
32
+ px: 4,
33
+ bg: themeGet("colors.black")(props),
34
+ "a[class^='StyledLink'], a[class*=' StyledLink'], div[class^='Badge'], div[class*=' Badge']": {
35
+ display: ["none", "none", "none", "block", "block"]
36
+ }
37
+ }), variant({
44
38
  variants: {
45
- "default": {
39
+ default: {
46
40
  width: "5px",
47
41
  height: "5px",
48
42
  backgroundColor: "#fff",
@@ -55,7 +49,7 @@ var Bar = styled("header").withConfig({
55
49
  }
56
50
  }
57
51
  }), space);
58
- var Switcher = styled("button").withConfig({
52
+ const Switcher = styled("button").withConfig({
59
53
  displayName: "Header__Switcher",
60
54
  componentId: "sc-yf04b-1"
61
55
  })(css({
@@ -73,7 +67,7 @@ var Switcher = styled("button").withConfig({
73
67
  backgroundColor: "#0091ea"
74
68
  }
75
69
  }));
76
- var SwitcherTopLeft = styled("div").withConfig({
70
+ const SwitcherTopLeft = styled("div").withConfig({
77
71
  displayName: "Header__SwitcherTopLeft",
78
72
  componentId: "sc-yf04b-2"
79
73
  })(css({
@@ -82,7 +76,7 @@ var SwitcherTopLeft = styled("div").withConfig({
82
76
  backgroundColor: "#fff",
83
77
  transition: "all 200ms ease-in-out"
84
78
  }));
85
- var SwitcherTopMiddle = styled("div").withConfig({
79
+ const SwitcherTopMiddle = styled("div").withConfig({
86
80
  displayName: "Header__SwitcherTopMiddle",
87
81
  componentId: "sc-yf04b-3"
88
82
  })(css({
@@ -91,7 +85,7 @@ var SwitcherTopMiddle = styled("div").withConfig({
91
85
  backgroundColor: "#fff",
92
86
  transition: "all 200ms ease-in-out"
93
87
  }));
94
- var SwitcherTopRight = styled("div").withConfig({
88
+ const SwitcherTopRight = styled("div").withConfig({
95
89
  displayName: "Header__SwitcherTopRight",
96
90
  componentId: "sc-yf04b-4"
97
91
  })(css({
@@ -100,7 +94,7 @@ var SwitcherTopRight = styled("div").withConfig({
100
94
  backgroundColor: "#fff",
101
95
  transition: "all 200ms ease-in-out"
102
96
  }));
103
- var SwitcherMiddleLeft = styled("div").withConfig({
97
+ const SwitcherMiddleLeft = styled("div").withConfig({
104
98
  displayName: "Header__SwitcherMiddleLeft",
105
99
  componentId: "sc-yf04b-5"
106
100
  })(css({
@@ -109,7 +103,7 @@ var SwitcherMiddleLeft = styled("div").withConfig({
109
103
  backgroundColor: "#fff",
110
104
  transition: "all 200ms ease-in-out"
111
105
  }));
112
- var SwitcherMiddleMiddle = styled("div").withConfig({
106
+ const SwitcherMiddleMiddle = styled("div").withConfig({
113
107
  displayName: "Header__SwitcherMiddleMiddle",
114
108
  componentId: "sc-yf04b-6"
115
109
  })(css({
@@ -118,7 +112,7 @@ var SwitcherMiddleMiddle = styled("div").withConfig({
118
112
  backgroundColor: "#fff",
119
113
  transition: "all 200ms ease-in-out"
120
114
  }));
121
- var SwitcherMiddleRight = styled("div").withConfig({
115
+ const SwitcherMiddleRight = styled("div").withConfig({
122
116
  displayName: "Header__SwitcherMiddleRight",
123
117
  componentId: "sc-yf04b-7"
124
118
  })(css({
@@ -127,7 +121,7 @@ var SwitcherMiddleRight = styled("div").withConfig({
127
121
  backgroundColor: "#fff",
128
122
  transition: "all 200ms ease-in-out"
129
123
  }));
130
- var SwitcherBottomLeft = styled("div").withConfig({
124
+ const SwitcherBottomLeft = styled("div").withConfig({
131
125
  displayName: "Header__SwitcherBottomLeft",
132
126
  componentId: "sc-yf04b-8"
133
127
  })(css({
@@ -136,7 +130,7 @@ var SwitcherBottomLeft = styled("div").withConfig({
136
130
  backgroundColor: "#fff",
137
131
  transition: "all 200ms ease-in-out"
138
132
  }));
139
- var SwitcherBottomMiddle = styled("div").withConfig({
133
+ const SwitcherBottomMiddle = styled("div").withConfig({
140
134
  displayName: "Header__SwitcherBottomMiddle",
141
135
  componentId: "sc-yf04b-9"
142
136
  })(css({
@@ -145,7 +139,7 @@ var SwitcherBottomMiddle = styled("div").withConfig({
145
139
  backgroundColor: "#fff",
146
140
  transition: "all 200ms ease-in-out"
147
141
  }));
148
- var SwitcherBottomRight = styled("div").withConfig({
142
+ const SwitcherBottomRight = styled("div").withConfig({
149
143
  displayName: "Header__SwitcherBottomRight",
150
144
  componentId: "sc-yf04b-10"
151
145
  })(css({
@@ -154,102 +148,90 @@ var SwitcherBottomRight = styled("div").withConfig({
154
148
  backgroundColor: "#fff",
155
149
  transition: "all 200ms ease-in-out"
156
150
  }));
157
- var AppsMenu = styled("div").withConfig({
151
+ const AppsMenu = styled("div").withConfig({
158
152
  displayName: "Header__AppsMenu",
159
153
  componentId: "sc-yf04b-11"
160
- })(function (props) {
161
- return css({
162
- backgroundColor: props.lightAppSwitcher ? "white" : "black",
163
- border: props.lightAppSwitcher ? "solid 1px rgba(0, 0, 0, 0.1)" : "none",
164
- color: props.lightAppSwitcher ? "black" : "white",
165
- width: "260px",
166
- display: "inline-block",
167
- position: "absolute",
168
- cursor: "default",
169
- top: "60px",
170
- left: "60px",
154
+ })(props => css({
155
+ backgroundColor: props.lightAppSwitcher ? "white" : "black",
156
+ border: props.lightAppSwitcher ? "solid 1px rgba(0, 0, 0, 0.1)" : "none",
157
+ color: props.lightAppSwitcher ? "black" : "white",
158
+ width: "260px",
159
+ display: "inline-block",
160
+ position: "absolute",
161
+ cursor: "default",
162
+ top: "60px",
163
+ left: "60px",
164
+ padding: "s",
165
+ borderRadius: "6px",
166
+ opacity: "0",
167
+ pointerEvents: "none",
168
+ transform: "translate(-10px, -10px)",
169
+ userSelect: "none",
170
+ zIndex: "-1",
171
+ transition: "all 200ms ease-in-out",
172
+ boxShadow: themeGet("shadows.boxDefault")(props),
173
+ "[class^='StyledLink'], [class*=' StyledLink']": {
174
+ color: props.lightAppSwitcher ? themeGet("colors.black")(props) : themeGet("colors.white")(props),
175
+ display: "block",
176
+ fontWeight: themeGet("fontWeights.2")(props),
171
177
  padding: "s",
172
- borderRadius: "6px",
173
- opacity: "0",
174
- pointerEvents: "none",
175
- transform: "translate(-10px, -10px)",
176
- userSelect: "none",
177
- zIndex: "-1",
178
- transition: "all 200ms ease-in-out",
179
- boxShadow: themeGet("shadows.boxDefault")(props),
180
- "[class^='StyledLink'], [class*=' StyledLink']": {
181
- color: props.lightAppSwitcher ? themeGet("colors.black")(props) : themeGet("colors.white")(props),
182
- display: "block",
183
- fontWeight: themeGet("fontWeights.2")(props),
184
- padding: "s",
185
- borderRadius: themeGet("radii.2")(props),
186
- "&:hover, &:focus": {
187
- textDecoration: "none",
188
- backgroundColor: props.lightAppSwitcher ? themeGet("colors.primaryLightest")(props) : themeGet("colors.primary")(props)
189
- }
178
+ borderRadius: themeGet("radii.2")(props),
179
+ "&:hover, &:focus": {
180
+ textDecoration: "none",
181
+ backgroundColor: props.lightAppSwitcher ? themeGet("colors.primaryLightest")(props) : themeGet("colors.primary")(props)
190
182
  }
191
- });
192
- }, function (props) {
193
- return props.isOpen ? css({
194
- opacity: "1",
195
- userSelect: "default",
196
- zIndex: "2",
197
- transform: "translate(0, 0)",
198
- pointerEvents: "auto"
199
- }) : null;
200
- });
201
- var WorkspaceSwitcher = styled("div").withConfig({
183
+ }
184
+ }), props => props.isOpen ? css({
185
+ opacity: "1",
186
+ userSelect: "default",
187
+ zIndex: "2",
188
+ transform: "translate(0, 0)",
189
+ pointerEvents: "auto"
190
+ }) : null);
191
+ const WorkspaceSwitcher = styled("div").withConfig({
202
192
  displayName: "Header__WorkspaceSwitcher",
203
193
  componentId: "sc-yf04b-12"
204
- })(function (props) {
205
- return css({
206
- borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
207
- paddingBottom: "s",
208
- "[class^='Small'], [class*=' Small']": {
209
- display: "block",
210
- fontWeight: themeGet("fontWeights.1")(props)
211
- }
212
- });
213
- });
214
- var InternalAppSwitcher = styled("div").withConfig({
194
+ })(props => css({
195
+ borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
196
+ paddingBottom: "s",
197
+ "[class^='Small'], [class*=' Small']": {
198
+ display: "block",
199
+ fontWeight: themeGet("fontWeights.1")(props)
200
+ }
201
+ }));
202
+ const InternalAppSwitcher = styled("div").withConfig({
215
203
  displayName: "Header__InternalAppSwitcher",
216
204
  componentId: "sc-yf04b-13"
217
- })(function (props) {
218
- return css({
219
- borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
220
- paddingBottom: "s",
221
- marginTop: "s",
222
- "[class^='Small'], [class*=' Small']": {
223
- display: "block",
224
- fontWeight: themeGet("fontWeights.1")(props)
225
- }
226
- });
227
- });
228
- var ExternalAppSwitcher = styled("div").withConfig({
205
+ })(props => css({
206
+ borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
207
+ paddingBottom: "s",
208
+ marginTop: "s",
209
+ "[class^='Small'], [class*=' Small']": {
210
+ display: "block",
211
+ fontWeight: themeGet("fontWeights.1")(props)
212
+ }
213
+ }));
214
+ const ExternalAppSwitcher = styled("div").withConfig({
229
215
  displayName: "Header__ExternalAppSwitcher",
230
216
  componentId: "sc-yf04b-14"
231
- })(function (props) {
232
- return css({
233
- marginTop: "s",
234
- "[class^='Small'], [class*=' Small']": {
235
- display: "block",
236
- fontWeight: themeGet("fontWeights.1")(props)
237
- }
238
- });
239
- });
240
- var AppName = styled("div").withConfig({
217
+ })(props => css({
218
+ marginTop: "s",
219
+ "[class^='Small'], [class*=' Small']": {
220
+ display: "block",
221
+ fontWeight: themeGet("fontWeights.1")(props)
222
+ }
223
+ }));
224
+ const AppName = styled("div").withConfig({
241
225
  displayName: "Header__AppName",
242
226
  componentId: "sc-yf04b-15"
243
- })(function (props) {
244
- return css({
245
- display: "flex",
246
- alignItems: "center",
247
- fontSize: themeGet("fontSizes.3")(props),
248
- color: themeGet("colors.white")(props)
249
- });
250
- }, variant({
227
+ })(props => css({
228
+ display: "flex",
229
+ alignItems: "center",
230
+ fontSize: themeGet("fontSizes.3")(props),
231
+ color: themeGet("colors.white")(props)
232
+ }), variant({
251
233
  variants: {
252
- "default": {
234
+ default: {
253
235
  width: "5px",
254
236
  height: "5px",
255
237
  backgroundColor: "#fff",
@@ -261,12 +243,12 @@ var AppName = styled("div").withConfig({
261
243
  }
262
244
  }
263
245
  }), space);
264
- var SearchContainer = styled("div").withConfig({
246
+ const SearchContainer = styled("div").withConfig({
265
247
  displayName: "Header__SearchContainer",
266
248
  componentId: "sc-yf04b-16"
267
249
  })(variant({
268
250
  variants: {
269
- "default": {
251
+ default: {
270
252
  display: "block"
271
253
  },
272
254
  search: {
@@ -282,200 +264,186 @@ var SearchContainer = styled("div").withConfig({
282
264
  }
283
265
  }
284
266
  }), space, layout);
285
- var MobileMenuToggle = styled("button").withConfig({
267
+ const MobileMenuToggle = styled("button").withConfig({
286
268
  displayName: "Header__MobileMenuToggle",
287
269
  componentId: "sc-yf04b-17"
288
- })(function (props) {
289
- return css({
290
- zIndex: 4,
291
- cursor: "pointer",
292
- userSelect: "none",
293
- background: "none",
294
- border: "none",
295
- position: "relative",
296
- padding: "0 0 7px",
297
- display: "block",
298
- "&:hover, &:focus": {
299
- outline: "0",
300
- span: {
301
- bg: themeGet("colors.white")(props),
302
- "&:before, &:after": {
303
- bg: themeGet("colors.white")(props)
304
- }
270
+ })(props => css({
271
+ zIndex: 4,
272
+ cursor: "pointer",
273
+ userSelect: "none",
274
+ background: "none",
275
+ border: "none",
276
+ position: "relative",
277
+ padding: "0 0 7px",
278
+ display: "block",
279
+ "&:hover, &:focus": {
280
+ outline: "0",
281
+ span: {
282
+ bg: themeGet("colors.white")(props),
283
+ "&:before, &:after": {
284
+ bg: themeGet("colors.white")(props)
305
285
  }
306
286
  }
307
- });
308
- });
309
- var Hamburger = styled("span").withConfig({
287
+ }
288
+ }));
289
+ const Hamburger = styled("span").withConfig({
310
290
  displayName: "Header__Hamburger",
311
291
  componentId: "sc-yf04b-18"
312
- })(function (props) {
313
- return css({
314
- "::before": {
315
- top: "calc(8px * 1.25)",
316
- position: "absolute",
317
- content: "''",
318
- display: "inline-block",
319
- width: "30px",
320
- height: "4px",
321
- borderRadius: themeGet("radii.2")(props),
322
- bg: themeGet("colors.white")(props),
323
- left: 0,
324
- transformOrigin: "50% 50%",
325
- transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1), background-color 300ms cubic-bezier(0.165, 0.84, 0.44, 1)"
326
- },
327
- "::after": {
328
- position: "absolute",
329
- top: "calc(8px * -1.25)",
330
- content: "''",
331
- display: "inline-block",
332
- width: "30px",
333
- height: "4px",
334
- borderRadius: themeGet("radii.2")(props),
335
- bg: themeGet("colors.white")(props),
336
- left: 0,
337
- transformOrigin: "50% 50%",
338
- transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1), background-color 300ms cubic-bezier(0.165, 0.84, 0.44, 1)"
339
- },
292
+ })(props => css({
293
+ "::before": {
294
+ top: "calc(8px * 1.25)",
295
+ position: "absolute",
296
+ content: "''",
340
297
  display: "inline-block",
341
- cursor: "pointer",
342
- userSelect: "none",
343
- transition: themeGet("transition.transitionDefault")(props),
344
298
  width: "30px",
345
299
  height: "4px",
346
300
  borderRadius: themeGet("radii.2")(props),
347
301
  bg: themeGet("colors.white")(props),
348
- position: "relative"
349
- });
350
- });
351
- var MobileNavToggle = styled("input").withConfig({
302
+ left: 0,
303
+ transformOrigin: "50% 50%",
304
+ transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1), background-color 300ms cubic-bezier(0.165, 0.84, 0.44, 1)"
305
+ },
306
+ "::after": {
307
+ position: "absolute",
308
+ top: "calc(8px * -1.25)",
309
+ content: "''",
310
+ display: "inline-block",
311
+ width: "30px",
312
+ height: "4px",
313
+ borderRadius: themeGet("radii.2")(props),
314
+ bg: themeGet("colors.white")(props),
315
+ left: 0,
316
+ transformOrigin: "50% 50%",
317
+ transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1), background-color 300ms cubic-bezier(0.165, 0.84, 0.44, 1)"
318
+ },
319
+ display: "inline-block",
320
+ cursor: "pointer",
321
+ userSelect: "none",
322
+ transition: themeGet("transition.transitionDefault")(props),
323
+ width: "30px",
324
+ height: "4px",
325
+ borderRadius: themeGet("radii.2")(props),
326
+ bg: themeGet("colors.white")(props),
327
+ position: "relative"
328
+ }));
329
+ const MobileNavToggle = styled("input").withConfig({
352
330
  displayName: "Header__MobileNavToggle",
353
331
  componentId: "sc-yf04b-19"
354
- })(function (props) {
355
- return css({
356
- opacity: "0",
357
- position: "absolute",
358
- visibility: "hidden",
359
- margin: 0,
360
- zIndex: 0,
361
- width: 0,
362
- height: 0,
363
- overflow: "hidden",
364
- pointerEvents: "none",
365
- "~ header, ~ div, ~ main": {
366
- transition: themeGet("transition.transitionDefault")(props)
332
+ })(props => css({
333
+ opacity: "0",
334
+ position: "absolute",
335
+ visibility: "hidden",
336
+ margin: 0,
337
+ zIndex: 0,
338
+ width: 0,
339
+ height: 0,
340
+ overflow: "hidden",
341
+ pointerEvents: "none",
342
+ "~ header, ~ div, ~ main": {
343
+ transition: themeGet("transition.transitionDefault")(props)
344
+ },
345
+ "&:checked": {
346
+ "~ [class^='Header__MobileNavMenu'], ~ [class*=' Header__MobileNavMenu']": {
347
+ transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
367
348
  },
368
- "&:checked": {
369
- "~ [class^='Header__MobileNavMenu'], ~ [class*=' Header__MobileNavMenu']": {
370
- transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
371
- },
372
- "~ main": {
373
- transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
374
- },
375
- "~ header": {
376
- transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
377
- },
378
- /* Hamburger */
379
- "~ [class^='Header__Bar'], ~ [class*=' Header__Bar']": {
380
- "[class^='Header__Hamburger'], [class*=' Header__Hamburger']": {
381
- bg: "transparent" /* fade away the middle line */,
382
- "&:hover,&:focus": {
383
- bg: "transparent"
384
- },
385
- "::before": {
386
- transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1)",
387
- top: 0,
388
- width: "24px",
389
- transform: "rotate3d(0,0,1,45deg) scale(1.1)"
390
- },
391
- "::after": {
392
- transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1)",
393
- top: 0,
394
- width: "24px",
395
- transform: "rotate3d(0,0,1,-45deg) scale(1.1)"
396
- }
349
+ "~ main": {
350
+ transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
351
+ },
352
+ "~ header": {
353
+ transform: "translateX(-" + themeGet("appScale.mobileNavMenuWidth")(props) + ")"
354
+ },
355
+ /* Hamburger */
356
+ "~ [class^='Header__Bar'], ~ [class*=' Header__Bar']": {
357
+ "[class^='Header__Hamburger'], [class*=' Header__Hamburger']": {
358
+ bg: "transparent" /* fade away the middle line */,
359
+ "&:hover,&:focus": {
360
+ bg: "transparent"
361
+ },
362
+ "::before": {
363
+ transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1)",
364
+ top: 0,
365
+ width: "24px",
366
+ transform: "rotate3d(0,0,1,45deg) scale(1.1)"
367
+ },
368
+ "::after": {
369
+ transition: "top 300ms cubic-bezier(0.165, 0.84, 0.44, 1), transform 300ms cubic-bezier(0.165, 0.84, 0.44, 1)",
370
+ top: 0,
371
+ width: "24px",
372
+ transform: "rotate3d(0,0,1,-45deg) scale(1.1)"
397
373
  }
398
- },
399
- /* Overlay */
400
- "~ label": {
401
- zIndex: 5,
402
- opacity: "1"
403
374
  }
375
+ },
376
+ /* Overlay */
377
+ "~ label": {
378
+ zIndex: 5,
379
+ opacity: "1"
404
380
  }
405
- });
406
- });
407
- var MobileNavMenu = styled("div").attrs(function (props) {
408
- return {
409
- "aria-hidden": "".concat(!props.isOpen)
410
- };
411
- }).withConfig({
381
+ }
382
+ }));
383
+ const MobileNavMenu = styled("div").attrs(props => ({
384
+ "aria-hidden": "".concat(!props.isOpen)
385
+ })).withConfig({
412
386
  displayName: "Header__MobileNavMenu",
413
387
  componentId: "sc-yf04b-20"
414
- })(function (props) {
415
- return css({
416
- display: props.isOpen ? "block" : "none",
417
- position: "fixed",
418
- overflowY: "auto",
419
- height: "100vh",
420
- right: "-" + themeGet("appScale.mobileNavMenuWidth")(props),
421
- top: 0,
422
- width: themeGet("appScale.mobileNavMenuWidth")(props),
423
- bg: themeGet("colors.greyDarkest")(props),
424
- zIndex: 6,
425
- transition: themeGet("transition.transitionDefault")(props),
426
- "[class^='StyledLink'], [class*=' StyledLink']": {
427
- color: themeGet("colors.white")(props),
428
- display: "block",
429
- fontWeight: themeGet("fontWeights.2")(props),
430
- padding: "r",
431
- borderRadius: themeGet("radii.2")(props),
432
- "&:hover, &:focus": {
433
- textDecoration: "none",
434
- backgroundColor: themeGet("colors.primary")(props)
435
- }
388
+ })(props => css({
389
+ display: props.isOpen ? "block" : "none",
390
+ position: "fixed",
391
+ overflowY: "auto",
392
+ height: "100vh",
393
+ right: "-" + themeGet("appScale.mobileNavMenuWidth")(props),
394
+ top: 0,
395
+ width: themeGet("appScale.mobileNavMenuWidth")(props),
396
+ bg: themeGet("colors.greyDarkest")(props),
397
+ zIndex: 6,
398
+ transition: themeGet("transition.transitionDefault")(props),
399
+ "[class^='StyledLink'], [class*=' StyledLink']": {
400
+ color: themeGet("colors.white")(props),
401
+ display: "block",
402
+ fontWeight: themeGet("fontWeights.2")(props),
403
+ padding: "r",
404
+ borderRadius: themeGet("radii.2")(props),
405
+ "&:hover, &:focus": {
406
+ textDecoration: "none",
407
+ backgroundColor: themeGet("colors.primary")(props)
436
408
  }
437
- });
438
- });
439
- var Theme = styled("div").withConfig({
409
+ }
410
+ }));
411
+ const Theme = styled("div").withConfig({
440
412
  displayName: "Header__Theme",
441
413
  componentId: "sc-yf04b-21"
442
- })(function (props) {
443
- return css({
444
- borderTop: "solid 1px rgba(255,255,255,0.3)",
445
- padding: "r",
446
- paddingTop: "s",
447
- marginTop: "s",
448
- "[class^='Small'], [class*=' Small']": {
449
- display: "block",
450
- fontWeight: themeGet("fontWeights.1")(props),
451
- marginTop: "xs"
452
- }
453
- });
454
- });
455
- var RightAligned = styled("div").withConfig({
414
+ })(props => css({
415
+ borderTop: "solid 1px rgba(255,255,255,0.3)",
416
+ padding: "r",
417
+ paddingTop: "s",
418
+ marginTop: "s",
419
+ "[class^='Small'], [class*=' Small']": {
420
+ display: "block",
421
+ fontWeight: themeGet("fontWeights.1")(props),
422
+ marginTop: "xs"
423
+ }
424
+ }));
425
+ const RightAligned = styled("div").withConfig({
456
426
  displayName: "Header__RightAligned",
457
427
  componentId: "sc-yf04b-22"
458
428
  })(css({
459
429
  marginLeft: "auto",
460
430
  marginRight: "r"
461
431
  }));
462
- var Overlay = styled("label").withConfig({
432
+ const Overlay = styled("label").withConfig({
463
433
  displayName: "Header__Overlay",
464
434
  componentId: "sc-yf04b-23"
465
- })(function (props) {
466
- return css({
467
- position: "fixed",
468
- top: 0,
469
- left: 0,
470
- height: "100vh",
471
- width: "100%",
472
- bg: themeGet("colors.black50")(props),
473
- zIndex: 0,
474
- opacity: "0",
475
- overflow: "hidden",
476
- transition: themeGet("transition.transitionDefault")(props)
477
- });
478
- });
435
+ })(props => css({
436
+ position: "fixed",
437
+ top: 0,
438
+ left: 0,
439
+ height: "100vh",
440
+ width: "100%",
441
+ bg: themeGet("colors.black50")(props),
442
+ zIndex: 0,
443
+ opacity: "0",
444
+ overflow: "hidden",
445
+ transition: themeGet("transition.transitionDefault")(props)
446
+ }));
479
447
 
480
448
  /**
481
449
  * Header component for global app navigation.
@@ -483,50 +451,43 @@ var Overlay = styled("label").withConfig({
483
451
  * At screen sizes less than 1100px the links are instead moved into a mobile menu toggled by a burger icon button to play nice with smaller devices.
484
452
  */
485
453
  export default function Header(_ref) {
486
- var appName = _ref.appName,
487
- userName = _ref.userName,
488
- avatarSource = _ref.avatarSource,
489
- children = _ref.children,
490
- sideMenuContent = _ref.sideMenuContent,
491
- internalAppSwitcherContent = _ref.internalAppSwitcherContent,
492
- externalAppSwitcherContent = _ref.externalAppSwitcherContent,
493
- rightAlignedContent = _ref.rightAlignedContent,
494
- logoutFunction = _ref.logoutFunction,
495
- searchComponent = _ref.searchComponent,
496
- dataTestId = _ref.dataTestId,
497
- theme = _ref.theme,
498
- variant = _ref.variant,
499
- themeSwitcherContent = _ref.themeSwitcherContent,
500
- workspaceSwitcherContent = _ref.workspaceSwitcherContent,
501
- _ref$navToggleId = _ref.navToggleId,
502
- navToggleId = _ref$navToggleId === void 0 ? "mobileMenuToggle" : _ref$navToggleId,
503
- currentWorkspace = _ref.currentWorkspace,
504
- logo = _ref.logo,
505
- appSwitcher = _ref.appSwitcher,
506
- lightAppSwitcher = _ref.lightAppSwitcher;
507
- var _useState = useState(false),
508
- _useState2 = _slicedToArray(_useState, 2),
509
- toggleState = _useState2[0],
510
- setToggle = _useState2[1];
511
- var _useState3 = useState(false),
512
- _useState4 = _slicedToArray(_useState3, 2),
513
- mobileMenuIsOpen = _useState4[0],
514
- setMobileMenuIsOpen = _useState4[1];
515
- var switcherRef = useRef();
516
- var menuRef = useRef();
517
- var toggleMobileMenu = function toggleMobileMenu() {
518
- setMobileMenuIsOpen(function (state) {
519
- return !state;
520
- });
454
+ let {
455
+ appName,
456
+ userName,
457
+ avatarSource,
458
+ children,
459
+ sideMenuContent,
460
+ internalAppSwitcherContent,
461
+ externalAppSwitcherContent,
462
+ rightAlignedContent,
463
+ logoutFunction,
464
+ searchComponent,
465
+ dataTestId,
466
+ theme,
467
+ variant,
468
+ themeSwitcherContent,
469
+ workspaceSwitcherContent,
470
+ navToggleId = "mobileMenuToggle",
471
+ currentWorkspace,
472
+ logo,
473
+ appSwitcher,
474
+ lightAppSwitcher
475
+ } = _ref;
476
+ const [toggleState, setToggle] = useState(false);
477
+ const [mobileMenuIsOpen, setMobileMenuIsOpen] = useState(false);
478
+ const switcherRef = useRef();
479
+ const menuRef = useRef();
480
+ const toggleMobileMenu = () => {
481
+ setMobileMenuIsOpen(state => !state);
521
482
  };
522
- var closeMenu = function closeMenu() {
483
+ const closeMenu = () => {
523
484
  setToggle(false);
524
485
  };
525
- useEffect(function () {
486
+ useEffect(() => {
526
487
  if (!toggleState) {
527
488
  return;
528
489
  }
529
- var handleClicked = function handleClicked(event) {
490
+ const handleClicked = event => {
530
491
  // As the event listener is attached in capture phase, need to do this make sure the sate change are after react event cycle.
531
492
  if (menuRef.current && !menuRef.current.contains(event.target) && switcherRef.current && !switcherRef.current.contains(event.target)) {
532
493
  closeMenu();
@@ -537,125 +498,161 @@ export default function Header(_ref) {
537
498
  // If any of the actions are using stopPropagation(), the event will stop in the react mounting root.
538
499
  // So use capture phase to detect anything clicked.
539
500
  document.addEventListener("click", handleClicked, true);
540
- return function () {
501
+ return () => {
541
502
  // If menu closed, unregister event listener to prevent memory leaks
542
503
  document.removeEventListener("click", handleClicked, true);
543
504
  };
544
505
  }, [toggleState, switcherRef]);
545
- var onToggle = function onToggle(e) {
506
+ const onToggle = e => {
546
507
  e.stopPropagation();
547
508
  setToggle(!toggleState);
548
509
  };
549
- var component = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileNavToggle, {
550
- type: "checkbox",
551
- checked: mobileMenuIsOpen,
552
- defaultChecked: mobileMenuIsOpen,
553
- id: navToggleId
554
- }), /*#__PURE__*/React.createElement(Bar, {
555
- theme: theme,
556
- dataTestId: dataTestId,
557
- variant: variant
558
- }, /*#__PURE__*/React.createElement(Flex, {
559
- alignItems: "center"
560
- }, appSwitcher && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switcher, {
561
- title: "Switch to...",
562
- onClick: onToggle,
563
- "aria-role": "navigation",
564
- "aria-label": "Toggle workspace and app switcher menu",
565
- ref: switcherRef
566
- }, /*#__PURE__*/React.createElement(SwitcherTopLeft, null), /*#__PURE__*/React.createElement(SwitcherTopMiddle, null), /*#__PURE__*/React.createElement(SwitcherTopRight, null), /*#__PURE__*/React.createElement(SwitcherMiddleLeft, null), /*#__PURE__*/React.createElement(SwitcherMiddleMiddle, null), /*#__PURE__*/React.createElement(SwitcherMiddleRight, null), /*#__PURE__*/React.createElement(SwitcherBottomLeft, null), /*#__PURE__*/React.createElement(SwitcherBottomMiddle, null), /*#__PURE__*/React.createElement(SwitcherBottomRight, null)), /*#__PURE__*/React.createElement(AppsMenu, {
567
- lightAppSwitcher: lightAppSwitcher,
568
- isOpen: toggleState,
569
- ref: menuRef
570
- }, workspaceSwitcherContent && /*#__PURE__*/React.createElement(WorkspaceSwitcher, null, /*#__PURE__*/React.createElement(Small, {
571
- color: lightAppSwitcher ? "black60" : "white60",
572
- pb: "s",
573
- display: "block"
574
- }, "Change workspace:"), workspaceSwitcherContent), internalAppSwitcherContent && /*#__PURE__*/React.createElement(InternalAppSwitcher, {
575
- lightAppSwitcher: lightAppSwitcher
576
- }, /*#__PURE__*/React.createElement(Small, {
577
- color: lightAppSwitcher ? "black60" : "white60",
578
- pb: "xs",
579
- display: "block"
580
- }, "Switch to:"), internalAppSwitcherContent), externalAppSwitcherContent && /*#__PURE__*/React.createElement(ExternalAppSwitcher, {
581
- lightAppSwitcher: lightAppSwitcher
582
- }, /*#__PURE__*/React.createElement(Small, {
583
- color: lightAppSwitcher ? "black60" : "white60",
584
- pb: "xs",
585
- display: "block"
586
- }, "External apps:"), externalAppSwitcherContent))), logo && /*#__PURE__*/React.createElement(FlexItem, null, logo), /*#__PURE__*/React.createElement(Flex, {
587
- flexDirection: "column",
588
- justifyContent: "center"
589
- }, /*#__PURE__*/React.createElement(AppName, {
590
- variant: variant
591
- }, appName), currentWorkspace && /*#__PURE__*/React.createElement(Small, {
592
- color: "white",
593
- fontSize: "0",
594
- display: ["none", "none", "none", "block"]
595
- }, currentWorkspace))), /*#__PURE__*/React.createElement(Spacer, {
596
- ml: 4
597
- }, children), searchComponent && /*#__PURE__*/React.createElement(SearchContainer, {
598
- variant: variant
599
- }, searchComponent), /*#__PURE__*/React.createElement(Flex, {
600
- alignItems: "center",
601
- ml: "auto"
602
- }, rightAlignedContent && /*#__PURE__*/React.createElement(RightAligned, null, rightAlignedContent), /*#__PURE__*/React.createElement(FlexItem, {
603
- flex: "1 0 auto",
604
- mr: "r",
605
- display: ["none", "none", "none", "none", "flex"]
606
- }, /*#__PURE__*/React.createElement(Avatar, {
607
- type: "inverted",
608
- sizing: "small",
609
- title: userName,
610
- image: avatarSource,
611
- theme: theme
612
- })), /*#__PURE__*/React.createElement(MobileMenuToggle, {
510
+ const component = /*#__PURE__*/_jsxs(_Fragment, {
511
+ children: [/*#__PURE__*/_jsx(MobileNavToggle, {
512
+ type: "checkbox",
513
+ checked: mobileMenuIsOpen,
514
+ defaultChecked: mobileMenuIsOpen,
515
+ id: navToggleId
516
+ }), /*#__PURE__*/_jsxs(Bar, {
517
+ theme: theme,
518
+ dataTestId: dataTestId,
519
+ variant: variant,
520
+ children: [/*#__PURE__*/_jsxs(Flex, {
521
+ alignItems: "center",
522
+ children: [appSwitcher && /*#__PURE__*/_jsxs(_Fragment, {
523
+ children: [/*#__PURE__*/_jsxs(Switcher, {
524
+ title: "Switch to...",
525
+ onClick: onToggle,
526
+ "aria-role": "navigation",
527
+ "aria-label": "Toggle workspace and app switcher menu",
528
+ ref: switcherRef,
529
+ children: [/*#__PURE__*/_jsx(SwitcherTopLeft, {}), /*#__PURE__*/_jsx(SwitcherTopMiddle, {}), /*#__PURE__*/_jsx(SwitcherTopRight, {}), /*#__PURE__*/_jsx(SwitcherMiddleLeft, {}), /*#__PURE__*/_jsx(SwitcherMiddleMiddle, {}), /*#__PURE__*/_jsx(SwitcherMiddleRight, {}), /*#__PURE__*/_jsx(SwitcherBottomLeft, {}), /*#__PURE__*/_jsx(SwitcherBottomMiddle, {}), /*#__PURE__*/_jsx(SwitcherBottomRight, {})]
530
+ }), /*#__PURE__*/_jsxs(AppsMenu, {
531
+ lightAppSwitcher: lightAppSwitcher,
532
+ isOpen: toggleState,
533
+ ref: menuRef,
534
+ children: [workspaceSwitcherContent && /*#__PURE__*/_jsxs(WorkspaceSwitcher, {
535
+ children: [/*#__PURE__*/_jsx(Small, {
536
+ color: lightAppSwitcher ? "black60" : "white60",
537
+ pb: "s",
538
+ display: "block",
539
+ children: "Change workspace:"
540
+ }), workspaceSwitcherContent]
541
+ }), internalAppSwitcherContent && /*#__PURE__*/_jsxs(InternalAppSwitcher, {
542
+ lightAppSwitcher: lightAppSwitcher,
543
+ children: [/*#__PURE__*/_jsx(Small, {
544
+ color: lightAppSwitcher ? "black60" : "white60",
545
+ pb: "xs",
546
+ display: "block",
547
+ children: "Switch to:"
548
+ }), internalAppSwitcherContent]
549
+ }), externalAppSwitcherContent && /*#__PURE__*/_jsxs(ExternalAppSwitcher, {
550
+ lightAppSwitcher: lightAppSwitcher,
551
+ children: [/*#__PURE__*/_jsx(Small, {
552
+ color: lightAppSwitcher ? "black60" : "white60",
553
+ pb: "xs",
554
+ display: "block",
555
+ children: "External apps:"
556
+ }), externalAppSwitcherContent]
557
+ })]
558
+ })]
559
+ }), logo && /*#__PURE__*/_jsx(FlexItem, {
560
+ children: logo
561
+ }), /*#__PURE__*/_jsxs(Flex, {
562
+ flexDirection: "column",
563
+ justifyContent: "center",
564
+ children: [/*#__PURE__*/_jsx(AppName, {
565
+ variant: variant,
566
+ children: appName
567
+ }), currentWorkspace && /*#__PURE__*/_jsx(Small, {
568
+ color: "white",
569
+ fontSize: "0",
570
+ display: ["none", "none", "none", "block"],
571
+ children: currentWorkspace
572
+ })]
573
+ })]
574
+ }), /*#__PURE__*/_jsx(Spacer, {
575
+ ml: 4,
576
+ children: children
577
+ }), searchComponent && /*#__PURE__*/_jsx(SearchContainer, {
578
+ variant: variant,
579
+ children: searchComponent
580
+ }), /*#__PURE__*/_jsxs(Flex, {
581
+ alignItems: "center",
582
+ ml: "auto",
583
+ children: [rightAlignedContent && /*#__PURE__*/_jsx(RightAligned, {
584
+ children: rightAlignedContent
585
+ }), /*#__PURE__*/_jsx(FlexItem, {
586
+ flex: "1 0 auto",
587
+ mr: "r",
588
+ display: ["none", "none", "none", "none", "flex"],
589
+ children: /*#__PURE__*/_jsx(Avatar, {
590
+ type: "inverted",
591
+ sizing: "small",
592
+ title: userName,
593
+ image: avatarSource,
594
+ theme: theme
595
+ })
596
+ }), /*#__PURE__*/_jsx(MobileMenuToggle, {
597
+ theme: theme,
598
+ onClick: toggleMobileMenu,
599
+ "aria-expanded": "".concat(mobileMenuIsOpen),
600
+ "aria-label": "Menu",
601
+ children: /*#__PURE__*/_jsx(Hamburger, {
602
+ id: "hamburger-menu-icon"
603
+ })
604
+ })]
605
+ })]
606
+ }), /*#__PURE__*/_jsx(MobileNavMenu, {
607
+ isOpen: mobileMenuIsOpen,
608
+ children: /*#__PURE__*/_jsxs(Box, {
609
+ m: "s",
610
+ children: [/*#__PURE__*/_jsx(Box, {
611
+ borderBottomWidth: 1,
612
+ borderBottomStyle: "solid",
613
+ borderBottomColor: "white20",
614
+ pt: "s",
615
+ pb: "r",
616
+ mb: "s",
617
+ display: ["block", "block", "block", "block", "none"],
618
+ children: /*#__PURE__*/_jsx(Avatar, {
619
+ type: "inverted",
620
+ sizing: "small",
621
+ title: userName,
622
+ image: avatarSource,
623
+ theme: theme
624
+ })
625
+ }), /*#__PURE__*/_jsx(Box, {
626
+ display: ["block", "block", "block", "none", "none"],
627
+ children: children
628
+ }), sideMenuContent, logoutFunction && /*#__PURE__*/_jsxs(StyledLink, {
629
+ id: "logoutButton",
630
+ white: true,
631
+ bold: true,
632
+ onClick: logoutFunction,
633
+ children: [/*#__PURE__*/_jsx(Icon, {
634
+ icon: ["fas", "lock"],
635
+ colour: "white",
636
+ mr: "s"
637
+ }), "Logout"]
638
+ }), themeSwitcherContent && /*#__PURE__*/_jsxs(Theme, {
639
+ children: [/*#__PURE__*/_jsx(Small, {
640
+ color: "white60",
641
+ pt: "s",
642
+ pb: "r",
643
+ display: "block",
644
+ children: "Switch theme:"
645
+ }), themeSwitcherContent]
646
+ })]
647
+ })
648
+ }), /*#__PURE__*/_jsx(Overlay, {
649
+ htmlFor: navToggleId
650
+ })]
651
+ });
652
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
613
653
  theme: theme,
614
- onClick: toggleMobileMenu,
615
- "aria-expanded": "".concat(mobileMenuIsOpen),
616
- "aria-label": "Menu"
617
- }, /*#__PURE__*/React.createElement(Hamburger, {
618
- id: "hamburger-menu-icon"
619
- })))), /*#__PURE__*/React.createElement(MobileNavMenu, {
620
- isOpen: mobileMenuIsOpen
621
- }, /*#__PURE__*/React.createElement(Box, {
622
- m: "s"
623
- }, /*#__PURE__*/React.createElement(Box, {
624
- borderBottomWidth: 1,
625
- borderBottomStyle: "solid",
626
- borderBottomColor: "white20",
627
- pt: "s",
628
- pb: "r",
629
- mb: "s",
630
- display: ["block", "block", "block", "block", "none"]
631
- }, /*#__PURE__*/React.createElement(Avatar, {
632
- type: "inverted",
633
- sizing: "small",
634
- title: userName,
635
- image: avatarSource,
636
- theme: theme
637
- })), /*#__PURE__*/React.createElement(Box, {
638
- display: ["block", "block", "block", "none", "none"]
639
- }, children), sideMenuContent, logoutFunction && /*#__PURE__*/React.createElement(StyledLink, {
640
- id: "logoutButton",
641
- white: true,
642
- bold: true,
643
- onClick: logoutFunction
644
- }, /*#__PURE__*/React.createElement(Icon, {
645
- icon: ["fas", "lock"],
646
- colour: "white",
647
- mr: "s"
648
- }), "Logout"), themeSwitcherContent && /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(Small, {
649
- color: "white60",
650
- pt: "s",
651
- pb: "r",
652
- display: "block"
653
- }, "Switch theme:"), themeSwitcherContent))), /*#__PURE__*/React.createElement(Overlay, {
654
- htmlFor: navToggleId
655
- }));
656
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
657
- theme: theme
658
- }, component) : component;
654
+ children: component
655
+ }) : component;
659
656
  }
660
657
  Header.propTypes = {
661
658
  /** Logo for app. Preferably an svg logo */