@pingux/astro 2.4.2-alpha.0 → 2.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Button/Buttons.styles.js +14 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +95 -48
- package/lib/cjs/components/Input/Input.styles.js +4 -1
- package/lib/cjs/components/NavBar/NavBar.js +22 -7
- package/lib/cjs/components/NavBar/NavBar.styles.js +126 -1
- package/lib/cjs/components/NavBarSection/NavBarItem.js +2 -2
- package/lib/cjs/components/NavBarSection/NavBarItemBody.js +3 -4
- package/lib/cjs/components/NavBarSection/NavBarItemBody.test.js +3 -2
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +2 -17
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +19 -11
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +1 -1
- package/lib/cjs/components/NavBarSection/NavBarSection.js +20 -7
- package/lib/cjs/hooks/useNavBarStyling/index.js +14 -0
- package/lib/cjs/hooks/useNavBarStyling/useNavBarStyling.js +49 -0
- package/lib/cjs/hooks/useNavBarStyling/useNavBarStyling.test.js +45 -0
- package/lib/cjs/recipes/MultipagePopup.stories.js +378 -0
- package/lib/cjs/styles/templates/Nav/HeaderBar.js +1 -1
- package/lib/components/Button/Buttons.styles.js +14 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +93 -47
- package/lib/components/Input/Input.styles.js +4 -1
- package/lib/components/NavBar/NavBar.js +22 -7
- package/lib/components/NavBar/NavBar.styles.js +126 -1
- package/lib/components/NavBarSection/NavBarItem.js +2 -2
- package/lib/components/NavBarSection/NavBarItemBody.js +3 -4
- package/lib/components/NavBarSection/NavBarItemBody.test.js +3 -2
- package/lib/components/NavBarSection/NavBarItemButton.js +2 -18
- package/lib/components/NavBarSection/NavBarItemHeader.js +19 -11
- package/lib/components/NavBarSection/NavBarItemLink.js +1 -1
- package/lib/components/NavBarSection/NavBarSection.js +21 -8
- package/lib/hooks/useNavBarStyling/index.js +1 -0
- package/lib/hooks/useNavBarStyling/useNavBarStyling.js +41 -0
- package/lib/hooks/useNavBarStyling/useNavBarStyling.test.js +42 -0
- package/lib/recipes/MultipagePopup.stories.js +365 -0
- package/lib/styles/templates/Nav/HeaderBar.js +1 -1
- package/package.json +1 -1
@@ -61,7 +61,7 @@ var HeaderBar = function HeaderBar() {
|
|
61
61
|
isRow: true,
|
62
62
|
alignItems: "center",
|
63
63
|
justifyContent: "space-between"
|
64
|
-
}, (0, _react2.jsx)(_EnvironmentBreadcrumb.
|
64
|
+
}, (0, _react2.jsx)(_EnvironmentBreadcrumb.DefaultClosed, null), (0, _react2.jsx)(_index.Box, {
|
65
65
|
isRow: true
|
66
66
|
}, (0, _react2.jsx)(_index.Box, {
|
67
67
|
isRow: true,
|
@@ -221,6 +221,19 @@ var colorBlock = {
|
|
221
221
|
borderColor: 'accent.20'
|
222
222
|
}
|
223
223
|
};
|
224
|
+
var headerBar = _objectSpread(_objectSpread({}, base), {}, {
|
225
|
+
backgroundColor: 'white',
|
226
|
+
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
227
|
+
border: 'none'
|
228
|
+
}),
|
229
|
+
'&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
|
230
|
+
border: 'none',
|
231
|
+
'> div > span': {
|
232
|
+
color: 'white'
|
233
|
+
}
|
234
|
+
}),
|
235
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
236
|
+
});
|
224
237
|
export default {
|
225
238
|
critical: critical,
|
226
239
|
"default": _objectSpread(_objectSpread({}, base), {}, {
|
@@ -232,6 +245,7 @@ export default {
|
|
232
245
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
233
246
|
}),
|
234
247
|
filter: filter,
|
248
|
+
headerBar: headerBar,
|
235
249
|
inline: inline,
|
236
250
|
inlinePrimary: inlinePrimary,
|
237
251
|
link: link,
|
@@ -154,17 +154,63 @@ export var Default = function Default(args) {
|
|
154
154
|
}) : null);
|
155
155
|
});
|
156
156
|
};
|
157
|
-
export var
|
158
|
-
var _useState3 = useState(
|
157
|
+
export var DefaultClosed = function DefaultClosed(args) {
|
158
|
+
var _useState3 = useState({
|
159
|
+
name: 'Snail',
|
160
|
+
isSandbox: true
|
161
|
+
}),
|
159
162
|
_useState4 = _slicedToArray(_useState3, 2),
|
160
|
-
|
161
|
-
|
162
|
-
var
|
163
|
+
selectedEnvironment = _useState4[0],
|
164
|
+
setSelectedEnvironment = _useState4[1];
|
165
|
+
var envNode = ___EmotionJSX(Box, {
|
166
|
+
isRow: true,
|
167
|
+
key: selectedEnvironment.name
|
168
|
+
}, ___EmotionJSX(Text, {
|
169
|
+
color: "inherit"
|
170
|
+
}, selectedEnvironment.name), selectedEnvironment.isSandbox ? ___EmotionJSX(Badge, {
|
171
|
+
label: "SANDBOX",
|
172
|
+
variant: "environmentBadge",
|
173
|
+
bg: "neutral.40"
|
174
|
+
}) : null);
|
175
|
+
var findEnvObj = function findEnvObj(envName) {
|
176
|
+
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref3) {
|
177
|
+
var name = _ref3.name;
|
178
|
+
return name === envName;
|
179
|
+
});
|
180
|
+
};
|
181
|
+
var handleSelectionChange = function handleSelectionChange(newEnvName) {
|
182
|
+
var envObj = findEnvObj(newEnvName);
|
183
|
+
setSelectedEnvironment(_objectSpread({}, envObj));
|
184
|
+
};
|
185
|
+
return ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, args, {
|
186
|
+
items: defaultEnvironments,
|
187
|
+
name: "Globochem",
|
188
|
+
selectedItem: envNode,
|
189
|
+
onSelectionChange: handleSelectionChange
|
190
|
+
}), function (_ref4) {
|
191
|
+
var name = _ref4.name,
|
192
|
+
isSandbox = _ref4.isSandbox;
|
193
|
+
return ___EmotionJSX(Item, {
|
194
|
+
key: name,
|
195
|
+
textValue: name
|
196
|
+
}, name, isSandbox ? ___EmotionJSX(Badge, {
|
197
|
+
label: "SANDBOX",
|
198
|
+
variant: "environmentBadge",
|
199
|
+
bg: "neutral.40"
|
200
|
+
}) : null);
|
201
|
+
});
|
202
|
+
};
|
203
|
+
export var WithSections = function WithSections() {
|
204
|
+
var _useState5 = useState(environmentsWithSections),
|
205
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
206
|
+
environments = _useState6[0],
|
207
|
+
setEnvironments = _useState6[1];
|
208
|
+
var _useState7 = useState({
|
163
209
|
name: 'Consumer Banking Prod'
|
164
210
|
}),
|
165
|
-
|
166
|
-
selectedEnvironment =
|
167
|
-
setSelectedEnvironment =
|
211
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
212
|
+
selectedEnvironment = _useState8[0],
|
213
|
+
setSelectedEnvironment = _useState8[1];
|
168
214
|
var recentEnvShown = 3;
|
169
215
|
var getUpdatedRecentEnvs = function getUpdatedRecentEnvs(envObj, prevEnvs) {
|
170
216
|
var _context3;
|
@@ -226,19 +272,19 @@ export var WithSections = function WithSections() {
|
|
226
272
|
selectedItem: envNode,
|
227
273
|
onSelectionChange: handleEnvPress,
|
228
274
|
isDefaultOpen: true
|
229
|
-
}, function (
|
230
|
-
var sectionName =
|
231
|
-
sectionOptions =
|
232
|
-
sectionKey =
|
275
|
+
}, function (_ref5) {
|
276
|
+
var sectionName = _ref5.name,
|
277
|
+
sectionOptions = _ref5.options,
|
278
|
+
sectionKey = _ref5.key;
|
233
279
|
return ___EmotionJSX(Section, {
|
234
280
|
key: sectionKey,
|
235
281
|
title: sectionName,
|
236
282
|
items: sectionOptions
|
237
|
-
}, function (
|
283
|
+
}, function (_ref6) {
|
238
284
|
var _context5;
|
239
|
-
var itemName =
|
240
|
-
itemOptions =
|
241
|
-
isSandbox =
|
285
|
+
var itemName = _ref6.name,
|
286
|
+
itemOptions = _ref6.options,
|
287
|
+
isSandbox = _ref6.isSandbox;
|
242
288
|
return ___EmotionJSX(Item, {
|
243
289
|
key: _concatInstanceProperty(_context5 = "".concat(sectionName, "-")).call(_context5, itemName),
|
244
290
|
childItems: itemOptions,
|
@@ -259,13 +305,13 @@ export var OrgLevel = function OrgLevel() {
|
|
259
305
|
});
|
260
306
|
};
|
261
307
|
export var DefaultOpen = function DefaultOpen() {
|
262
|
-
var
|
308
|
+
var _useState9 = useState({
|
263
309
|
name: 'Dog',
|
264
310
|
isSandbox: true
|
265
311
|
}),
|
266
|
-
|
267
|
-
selectedEnvironment =
|
268
|
-
setSelectedEnvironment =
|
312
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
313
|
+
selectedEnvironment = _useState10[0],
|
314
|
+
setSelectedEnvironment = _useState10[1];
|
269
315
|
var envNode = ___EmotionJSX(Box, {
|
270
316
|
isRow: true,
|
271
317
|
key: selectedEnvironment.name
|
@@ -277,8 +323,8 @@ export var DefaultOpen = function DefaultOpen() {
|
|
277
323
|
bg: "neutral.40"
|
278
324
|
}) : null);
|
279
325
|
var findEnvObj = function findEnvObj(envName) {
|
280
|
-
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (
|
281
|
-
var name =
|
326
|
+
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref7) {
|
327
|
+
var name = _ref7.name;
|
282
328
|
return name === envName;
|
283
329
|
});
|
284
330
|
};
|
@@ -292,9 +338,9 @@ export var DefaultOpen = function DefaultOpen() {
|
|
292
338
|
selectedItem: envNode,
|
293
339
|
onSelectionChange: handleSelectionChange,
|
294
340
|
isDefaultOpen: true
|
295
|
-
}, function (
|
296
|
-
var name =
|
297
|
-
isSandbox =
|
341
|
+
}, function (_ref8) {
|
342
|
+
var name = _ref8.name,
|
343
|
+
isSandbox = _ref8.isSandbox;
|
298
344
|
return ___EmotionJSX(Item, {
|
299
345
|
key: name,
|
300
346
|
textValue: name
|
@@ -306,17 +352,17 @@ export var DefaultOpen = function DefaultOpen() {
|
|
306
352
|
});
|
307
353
|
};
|
308
354
|
export var ControlledMenu = function ControlledMenu() {
|
309
|
-
var
|
310
|
-
|
311
|
-
isOpen =
|
312
|
-
setIsOpen =
|
313
|
-
var
|
355
|
+
var _useState11 = useState(false),
|
356
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
357
|
+
isOpen = _useState12[0],
|
358
|
+
setIsOpen = _useState12[1];
|
359
|
+
var _useState13 = useState({
|
314
360
|
name: 'Shark',
|
315
361
|
isSandbox: true
|
316
362
|
}),
|
317
|
-
|
318
|
-
selectedEnvironment =
|
319
|
-
setSelectedEnvironment =
|
363
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
364
|
+
selectedEnvironment = _useState14[0],
|
365
|
+
setSelectedEnvironment = _useState14[1];
|
320
366
|
var envNode = ___EmotionJSX(Box, {
|
321
367
|
isRow: true,
|
322
368
|
key: selectedEnvironment.name
|
@@ -328,8 +374,8 @@ export var ControlledMenu = function ControlledMenu() {
|
|
328
374
|
bg: "neutral.40"
|
329
375
|
}) : null);
|
330
376
|
var findEnvObj = function findEnvObj(envName) {
|
331
|
-
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (
|
332
|
-
var name =
|
377
|
+
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref9) {
|
378
|
+
var name = _ref9.name;
|
333
379
|
return name === envName;
|
334
380
|
});
|
335
381
|
};
|
@@ -344,9 +390,9 @@ export var ControlledMenu = function ControlledMenu() {
|
|
344
390
|
onSelectionChange: handleSelectionChange,
|
345
391
|
isOpen: isOpen,
|
346
392
|
onOpenChange: setIsOpen
|
347
|
-
}, function (
|
348
|
-
var name =
|
349
|
-
isSandbox =
|
393
|
+
}, function (_ref10) {
|
394
|
+
var name = _ref10.name,
|
395
|
+
isSandbox = _ref10.isSandbox;
|
350
396
|
return ___EmotionJSX(Item, {
|
351
397
|
key: name,
|
352
398
|
textValue: name
|
@@ -358,13 +404,13 @@ export var ControlledMenu = function ControlledMenu() {
|
|
358
404
|
});
|
359
405
|
};
|
360
406
|
export var RightAlignedBadges = function RightAlignedBadges(args) {
|
361
|
-
var
|
407
|
+
var _useState15 = useState({
|
362
408
|
name: 'Snail',
|
363
409
|
isSandbox: true
|
364
410
|
}),
|
365
|
-
|
366
|
-
selectedEnvironment =
|
367
|
-
setSelectedEnvironment =
|
411
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
412
|
+
selectedEnvironment = _useState16[0],
|
413
|
+
setSelectedEnvironment = _useState16[1];
|
368
414
|
var envNode = ___EmotionJSX(Box, {
|
369
415
|
isRow: true
|
370
416
|
}, ___EmotionJSX(Text, {
|
@@ -375,8 +421,8 @@ export var RightAlignedBadges = function RightAlignedBadges(args) {
|
|
375
421
|
bg: "neutral.40"
|
376
422
|
}) : null);
|
377
423
|
var findEnvObj = function findEnvObj(envName) {
|
378
|
-
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (
|
379
|
-
var name =
|
424
|
+
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref11) {
|
425
|
+
var name = _ref11.name;
|
380
426
|
return name === envName;
|
381
427
|
});
|
382
428
|
};
|
@@ -418,9 +464,9 @@ export var RightAlignedBadges = function RightAlignedBadges(args) {
|
|
418
464
|
name: "Globochem",
|
419
465
|
selectedItem: envNode,
|
420
466
|
onSelectionChange: handleSelectionChange
|
421
|
-
}), function (
|
422
|
-
var name =
|
423
|
-
isSandbox =
|
467
|
+
}), function (_ref12) {
|
468
|
+
var name = _ref12.name,
|
469
|
+
isSandbox = _ref12.isSandbox;
|
424
470
|
return ___EmotionJSX(Item, {
|
425
471
|
key: name,
|
426
472
|
textValue: name
|
@@ -199,7 +199,10 @@ input.multivaluesWrapper = _objectSpread(_objectSpread({}, input.fieldControlWra
|
|
199
199
|
outline: 'none'
|
200
200
|
}
|
201
201
|
},
|
202
|
-
'&.is-focused': _objectSpread({}, defaultFocus)
|
202
|
+
'&.is-focused': _objectSpread({}, defaultFocus),
|
203
|
+
'&.is-error': {
|
204
|
+
borderColor: 'critical.dark'
|
205
|
+
}
|
203
206
|
}, _defineProperty(_objectSpread2, "&.is-".concat(statuses.ERROR, "::after"), {
|
204
207
|
bg: 'critical.bright'
|
205
208
|
}), _defineProperty(_objectSpread2, "&.is-".concat(statuses.SUCCESS, "::after"), {
|
@@ -1,10 +1,14 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
1
2
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
3
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
4
|
+
var _excluded = ["defaultSelectedKey", "selectedKey", "setSelectedKey", "hasRestoreFocus", "defaultExpandedKeys", "children", "variant"];
|
2
5
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
3
6
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
4
7
|
import React, { useState } from 'react';
|
5
8
|
import { FocusScope, useFocusManager } from '@react-aria/focus';
|
6
9
|
import PropTypes from 'prop-types';
|
7
10
|
import { NavBarContext } from '../../context/NavBarContext';
|
11
|
+
import useNavBarStyling from '../../hooks/useNavBarStyling/useNavBarStyling';
|
8
12
|
import useProgressiveState from '../../hooks/useProgressiveState';
|
9
13
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
10
14
|
import Box from '../Box/Box';
|
@@ -23,8 +27,11 @@ var NavBar = function NavBar(props) {
|
|
23
27
|
var defaultSelectedKey = props.defaultSelectedKey,
|
24
28
|
selectedKeyProp = props.selectedKey,
|
25
29
|
setSelectedKeyProp = props.setSelectedKey,
|
30
|
+
hasRestoreFocus = props.hasRestoreFocus,
|
26
31
|
defaultExpandedKeys = props.defaultExpandedKeys,
|
27
|
-
children = props.children
|
32
|
+
children = props.children,
|
33
|
+
variant = props.variant,
|
34
|
+
others = _objectWithoutProperties(props, _excluded);
|
28
35
|
var _useState = useState(defaultExpandedKeys),
|
29
36
|
_useState2 = _slicedToArray(_useState, 2),
|
30
37
|
expandedKeys = _useState2[0],
|
@@ -33,6 +40,7 @@ var NavBar = function NavBar(props) {
|
|
33
40
|
_useProgressiveState2 = _slicedToArray(_useProgressiveState, 2),
|
34
41
|
selectedKey = _useProgressiveState2[0],
|
35
42
|
setSelectedKey = _useProgressiveState2[1];
|
43
|
+
var navStyles = useNavBarStyling(variant);
|
36
44
|
var items = _Array$isArray(children) ? _mapInstanceProperty(children).call(children, function (child) {
|
37
45
|
return {
|
38
46
|
item: child,
|
@@ -46,16 +54,17 @@ var NavBar = function NavBar(props) {
|
|
46
54
|
selectedKey: selectedKey,
|
47
55
|
setSelectedKey: setSelectedKeyProp || setSelectedKey,
|
48
56
|
expandedKeys: expandedKeys,
|
49
|
-
setExpandedKeys: setExpandedKeys
|
57
|
+
setExpandedKeys: setExpandedKeys,
|
58
|
+
navStyles: navStyles
|
50
59
|
};
|
51
60
|
return ___EmotionJSX(NavBarContext.Provider, {
|
52
61
|
value: contextValue
|
53
|
-
}, ___EmotionJSX(Box, {
|
54
|
-
variant:
|
62
|
+
}, ___EmotionJSX(Box, _extends({
|
63
|
+
variant: navStyles.navBar,
|
55
64
|
role: "navigation",
|
56
65
|
as: "nav"
|
57
|
-
}, items.length ? ___EmotionJSX(FocusScope, {
|
58
|
-
restoreFocus:
|
66
|
+
}, others), items.length ? ___EmotionJSX(FocusScope, {
|
67
|
+
restoreFocus: hasRestoreFocus
|
59
68
|
}, _mapInstanceProperty(items).call(items, function (_ref) {
|
60
69
|
var item = _ref.item,
|
61
70
|
key = _ref.key;
|
@@ -88,6 +97,10 @@ var FocusableItem = function FocusableItem(props) {
|
|
88
97
|
return childWithFocusHandle;
|
89
98
|
};
|
90
99
|
NavBar.propTypes = {
|
100
|
+
/** This applies a style to the entire nav tree. the options are default and popup. */
|
101
|
+
variant: PropTypes.oneOf(['default', 'popupNav']),
|
102
|
+
/** Whether or not the focus will return to the previously focused element upon unmount. */
|
103
|
+
hasRestoreFocus: PropTypes.bool,
|
91
104
|
/** The initial selected key in the collection (uncontrolled). */
|
92
105
|
defaultSelectedKey: PropTypes.string,
|
93
106
|
/** The initial expanded keys in the collection (uncontrolled). */
|
@@ -103,6 +116,8 @@ NavBar.propTypes = {
|
|
103
116
|
};
|
104
117
|
NavBar.defaultProps = {
|
105
118
|
defaultSelectedKey: '',
|
106
|
-
defaultExpandedKeys: []
|
119
|
+
defaultExpandedKeys: [],
|
120
|
+
variant: 'default',
|
121
|
+
hasRestoreFocus: true
|
107
122
|
};
|
108
123
|
export default NavBar;
|
@@ -22,6 +22,14 @@ var container = {
|
|
22
22
|
backgroundColor: 'accent.20',
|
23
23
|
overflowY: 'hidden'
|
24
24
|
};
|
25
|
+
var popUpContainer = _objectSpread(_objectSpread({}, container), {}, {
|
26
|
+
minWidth: '184px',
|
27
|
+
maxWidth: '184px',
|
28
|
+
width: '184px',
|
29
|
+
backgroundColor: 'white',
|
30
|
+
borderRight: '3px solid',
|
31
|
+
borderRightColor: 'active'
|
32
|
+
});
|
25
33
|
var itemHeaderContainer = {
|
26
34
|
flexGrow: 1,
|
27
35
|
alignItems: 'center',
|
@@ -35,6 +43,18 @@ var itemHeaderContainer = {
|
|
35
43
|
boxShadow: 'inset 2px 0 0 0 white'
|
36
44
|
}
|
37
45
|
};
|
46
|
+
var popUpItemHeaderContainer = _objectSpread(_objectSpread({}, itemHeaderContainer), {}, {
|
47
|
+
minHeight: '36px',
|
48
|
+
maxWidth: '184px',
|
49
|
+
pl: 'sm',
|
50
|
+
pr: 'sm',
|
51
|
+
'&.is-selected': {
|
52
|
+
backgroundColor: 'active'
|
53
|
+
}
|
54
|
+
});
|
55
|
+
var popUpItemListItem = {
|
56
|
+
borderBottom: '1px solid #BDBDBD'
|
57
|
+
};
|
38
58
|
var sectionContainer = {
|
39
59
|
pt: 'sm',
|
40
60
|
height: '100%',
|
@@ -66,6 +86,36 @@ var sectionContainer = {
|
|
66
86
|
scrollbarColor: 'rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2)'
|
67
87
|
}
|
68
88
|
};
|
89
|
+
var popUpSectionContainer = {
|
90
|
+
height: '100%',
|
91
|
+
maxHeight: '100%',
|
92
|
+
overflowY: 'auto',
|
93
|
+
// these rules are for webkit browsers: chrome, safari, edge
|
94
|
+
'&::-webkit-scrollbar-thumb': {
|
95
|
+
backgroundColor: 'rgba(147, 163, 219, 1)',
|
96
|
+
borderRadius: '5px'
|
97
|
+
},
|
98
|
+
'&::-webkit-scrollbar': {
|
99
|
+
width: 7
|
100
|
+
},
|
101
|
+
'&::-webkit-scrollbar-track': {
|
102
|
+
backgroundColor: 'accent.95'
|
103
|
+
},
|
104
|
+
// this is a newer standard that only ff supports for now
|
105
|
+
scrollbarColor: 'rgba(229, 233, 248, 1) rgba(0, 0, 0, 0.1)',
|
106
|
+
// can't use theme values here, unfortunately
|
107
|
+
// different colors while hovering over the nav bar
|
108
|
+
'&:hover': {
|
109
|
+
'&::-webkit-scrollbar-thumb': {
|
110
|
+
backgroundColor: 'rgba(147, 163, 219, 1)',
|
111
|
+
borderRadius: '4px'
|
112
|
+
},
|
113
|
+
'&::-webkit-scrollbar-track': {
|
114
|
+
backgroundColor: 'accent.95'
|
115
|
+
},
|
116
|
+
scrollbarColor: 'rgba(229, 233, 248, 1) rgba(0, 0, 0, 0.2)'
|
117
|
+
}
|
118
|
+
};
|
69
119
|
var sectionBody = _objectSpread(_objectSpread({}, accordionGrid.body), {}, {
|
70
120
|
pl: '0'
|
71
121
|
});
|
@@ -89,6 +139,8 @@ var itemButton = {
|
|
89
139
|
maxWidth: '100%',
|
90
140
|
wordWrap: 'break-word',
|
91
141
|
wordBreak: 'break-word',
|
142
|
+
paddingLeft: '45px',
|
143
|
+
paddingRight: '45px',
|
92
144
|
'&.is-focused': {
|
93
145
|
outline: '1px solid',
|
94
146
|
outlineColor: 'focus'
|
@@ -104,6 +156,28 @@ var itemButton = {
|
|
104
156
|
bg: 'accent.5'
|
105
157
|
}
|
106
158
|
};
|
159
|
+
var popUpItemButton = _objectSpread(_objectSpread({}, itemButton), {}, {
|
160
|
+
fontSize: 'sm',
|
161
|
+
px: 'sm',
|
162
|
+
color: 'text.primary',
|
163
|
+
'&.is-focused': {
|
164
|
+
outline: '1px solid',
|
165
|
+
outlineColor: 'focus',
|
166
|
+
outlineOffset: '2px'
|
167
|
+
},
|
168
|
+
'&.is-selected': {
|
169
|
+
bg: 'active',
|
170
|
+
color: 'white'
|
171
|
+
},
|
172
|
+
'&.is-hovered': {
|
173
|
+
bg: 'neutral.90',
|
174
|
+
color: 'text.primary'
|
175
|
+
},
|
176
|
+
'&.is-pressed': {
|
177
|
+
bg: 'active',
|
178
|
+
color: 'white'
|
179
|
+
}
|
180
|
+
});
|
107
181
|
var subtitle = {
|
108
182
|
ml: 'md',
|
109
183
|
my: 'sm',
|
@@ -123,6 +197,16 @@ var headerText = _objectSpread(_objectSpread({}, wordWrap), {}, {
|
|
123
197
|
color: 'white'
|
124
198
|
}
|
125
199
|
});
|
200
|
+
var popUpHeaderText = _objectSpread(_objectSpread({}, headerText), {}, {
|
201
|
+
fontWeight: 3,
|
202
|
+
color: 'text.primary',
|
203
|
+
'.is-pressed &': {
|
204
|
+
color: 'white'
|
205
|
+
},
|
206
|
+
'.is-selected &': {
|
207
|
+
color: 'white'
|
208
|
+
}
|
209
|
+
});
|
126
210
|
var headerNav = {
|
127
211
|
cursor: 'pointer',
|
128
212
|
minHeight: '40px',
|
@@ -158,6 +242,13 @@ var item = _objectSpread(_objectSpread({}, headerNav), {}, {
|
|
158
242
|
boxShadow: 'inset 2px 0 0 0 white'
|
159
243
|
}
|
160
244
|
});
|
245
|
+
var popUpItem = _objectSpread(_objectSpread({}, headerNav), {}, {
|
246
|
+
py: 'sm',
|
247
|
+
px: 'md',
|
248
|
+
'&.is-selected': {
|
249
|
+
boxShadow: 'inset 2px 0 0 0 white'
|
250
|
+
}
|
251
|
+
});
|
161
252
|
var sectionButton = _objectSpread(_objectSpread({}, quiet), {}, {
|
162
253
|
width: '100%',
|
163
254
|
'&.is-focused': {
|
@@ -171,15 +262,49 @@ var sectionButton = _objectSpread(_objectSpread({}, quiet), {}, {
|
|
171
262
|
backgroundColor: 'accent.5'
|
172
263
|
}
|
173
264
|
});
|
265
|
+
var popUpSectionButton = _objectSpread(_objectSpread({}, quiet), {}, {
|
266
|
+
width: '100%',
|
267
|
+
'&.is-focused': {
|
268
|
+
outline: '1px solid',
|
269
|
+
outlineColor: 'focus'
|
270
|
+
},
|
271
|
+
'&.is-hovered': {
|
272
|
+
backgroundColor: 'neutral.90'
|
273
|
+
},
|
274
|
+
'&.is-pressed': {
|
275
|
+
backgroundColor: 'active',
|
276
|
+
color: 'white'
|
277
|
+
},
|
278
|
+
'&.is-pressed > div > div > svg > path': {
|
279
|
+
fill: 'white !important'
|
280
|
+
}
|
281
|
+
});
|
282
|
+
var navBarItemBody = {
|
283
|
+
alignItems: 'stretch',
|
284
|
+
mb: 'md'
|
285
|
+
};
|
286
|
+
var popUpNavBarItemBody = _objectSpread(_objectSpread({}, navBarItemBody), {}, {
|
287
|
+
mb: 0
|
288
|
+
});
|
174
289
|
export default {
|
175
290
|
container: container,
|
291
|
+
popUpContainer: popUpContainer,
|
176
292
|
itemHeaderContainer: itemHeaderContainer,
|
293
|
+
popUpItemHeaderContainer: popUpItemHeaderContainer,
|
294
|
+
popUpItemListItem: popUpItemListItem,
|
177
295
|
sectionContainer: sectionContainer,
|
296
|
+
popUpSectionContainer: popUpSectionContainer,
|
178
297
|
sectionBody: sectionBody,
|
179
298
|
sectionButton: sectionButton,
|
299
|
+
popUpSectionButton: popUpSectionButton,
|
180
300
|
itemButton: itemButton,
|
301
|
+
popUpItemButton: popUpItemButton,
|
181
302
|
subtitle: subtitle,
|
182
303
|
headerText: headerText,
|
304
|
+
popUpHeaderText: popUpHeaderText,
|
183
305
|
headerNav: headerNav,
|
184
|
-
item: item
|
306
|
+
item: item,
|
307
|
+
popUpItem: popUpItem,
|
308
|
+
navBarItemBody: navBarItemBody,
|
309
|
+
popUpNavBarItemBody: popUpNavBarItemBody
|
185
310
|
};
|
@@ -56,7 +56,7 @@ var NavBarItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
56
56
|
var color = isSelected ? 'white' : 'neutral.95';
|
57
57
|
return ___EmotionJSX(Box, _extends({
|
58
58
|
id: key,
|
59
|
-
variant:
|
59
|
+
variant: state.navStyles.navBarItem,
|
60
60
|
isRow: true,
|
61
61
|
tabIndex: 0,
|
62
62
|
className: classNames,
|
@@ -80,7 +80,7 @@ var NavBarItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
80
80
|
fill: color
|
81
81
|
}
|
82
82
|
}), ___EmotionJSX(Text, {
|
83
|
-
variant:
|
83
|
+
variant: state.navStyles.navBarItemText
|
84
84
|
}, text)));
|
85
85
|
});
|
86
86
|
NavBarItem.propTypes = {
|
@@ -3,12 +3,14 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
3
3
|
import React, { Fragment } from 'react';
|
4
4
|
import { useKeyboard } from '@react-aria/interactions';
|
5
5
|
import PropTypes from 'prop-types';
|
6
|
+
import { useNavBarContext } from '../../context/NavBarContext';
|
6
7
|
import { Box, Separator, Text } from '../../index';
|
7
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
9
|
var NavBarItemBody = function NavBarItemBody(_ref) {
|
9
10
|
var _context;
|
10
11
|
var item = _ref.item,
|
11
12
|
onKeyDown = _ref.onKeyDown;
|
13
|
+
var state = useNavBarContext();
|
12
14
|
var renderSubTitle = function renderSubTitle(child) {
|
13
15
|
var _child$hasSeparator = child.hasSeparator,
|
14
16
|
hasSeparator = _child$hasSeparator === void 0 ? true : _child$hasSeparator,
|
@@ -31,10 +33,7 @@ var NavBarItemBody = function NavBarItemBody(_ref) {
|
|
31
33
|
}, child);
|
32
34
|
};
|
33
35
|
return ___EmotionJSX(Box, {
|
34
|
-
|
35
|
-
alignItems: 'stretch',
|
36
|
-
mb: 'md'
|
37
|
-
}
|
36
|
+
variant: state.navStyles.navBarItemBody
|
38
37
|
}, _mapInstanceProperty(_context = item.children).call(_context, renderChild));
|
39
38
|
};
|
40
39
|
var ChildItemWrapper = function ChildItemWrapper(_ref2) {
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Text } from '../..';
|
3
3
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
4
|
+
import NavBar from '../NavBar';
|
4
5
|
import NavBarItemBody from './NavBarItemBody';
|
5
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
7
|
var getComponent = function getComponent(item) {
|
7
|
-
return render(___EmotionJSX(NavBarItemBody, {
|
8
|
+
return render(___EmotionJSX(NavBar, null, ___EmotionJSX(NavBarItemBody, {
|
8
9
|
item: {
|
9
10
|
children: [item]
|
10
11
|
}
|
11
|
-
}));
|
12
|
+
})));
|
12
13
|
};
|
13
14
|
var SUBTITLE = 'subtitle';
|
14
15
|
var TEXT = 'text';
|
@@ -1,17 +1,6 @@
|
|
1
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
12
3
|
var _excluded = ["className", "id", "onPress", "sx"];
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
4
|
import React from 'react';
|
16
5
|
import PropTypes from 'prop-types';
|
17
6
|
import { useNavBarContext } from '../../context/NavBarContext';
|
@@ -37,16 +26,11 @@ var NavBarItemButton = function NavBarItemButton(props) {
|
|
37
26
|
classNames = _useStatusClasses.classNames;
|
38
27
|
return ___EmotionJSX(Button, _extends({
|
39
28
|
id: key,
|
40
|
-
variant:
|
29
|
+
variant: state.navStyles.navBarItemButton,
|
41
30
|
onPress: onNavPress,
|
42
31
|
className: classNames,
|
43
32
|
color: isSelected ? 'white' : undefined
|
44
|
-
}, others
|
45
|
-
sx: _objectSpread({
|
46
|
-
paddingLeft: '45px',
|
47
|
-
paddingRight: '45px'
|
48
|
-
}, sx)
|
49
|
-
}));
|
33
|
+
}, others));
|
50
34
|
};
|
51
35
|
NavBarItemButton.propTypes = {
|
52
36
|
/** Handler that is called when the press is released over the target. */
|