@pingux/astro 2.53.0 → 2.53.1-alpha.1
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/Label/Label.styles.js +1 -1
- package/lib/cjs/components/NavBar/NavBar.d.ts +4 -0
- package/lib/cjs/components/NavBar/NavBar.js +5 -26
- package/lib/cjs/components/NavBar/NavBar.stories.d.ts +7 -0
- package/lib/cjs/components/NavBar/NavBar.stories.js +1 -1
- package/lib/cjs/components/NavBar/NavBar.styles.d.ts +364 -0
- package/lib/cjs/components/NavBar/NavBar.test.d.ts +1 -0
- package/lib/cjs/components/NavBar/index.d.ts +1 -0
- package/lib/cjs/components/NavBarSection/NavBarItem.d.ts +4 -0
- package/lib/cjs/components/NavBarSection/NavBarItem.js +1 -12
- package/lib/cjs/components/NavBarSection/NavBarItemBody.d.ts +4 -0
- package/lib/cjs/components/NavBarSection/NavBarItemBody.js +6 -11
- package/lib/cjs/components/NavBarSection/NavBarItemBody.test.d.ts +1 -0
- package/lib/cjs/components/NavBarSection/NavBarItemButton.d.ts +4 -0
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +0 -7
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.d.ts +4 -0
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +9 -33
- package/lib/cjs/components/NavBarSection/NavBarItemLink.d.ts +4 -0
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +0 -9
- package/lib/cjs/components/NavBarSection/NavBarSection.d.ts +9 -0
- package/lib/cjs/components/NavBarSection/NavBarSection.js +18 -50
- package/lib/cjs/components/NavBarSection/index.d.ts +4 -0
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.d.ts +1 -1
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.js +5 -3
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +23 -12
- package/lib/cjs/types/link.d.ts +4 -0
- package/lib/cjs/types/navBar.d.ts +136 -0
- package/lib/cjs/types/navBar.js +6 -0
- package/lib/components/Label/Label.styles.js +1 -1
- package/lib/components/NavBar/NavBar.js +5 -26
- package/lib/components/NavBar/NavBar.stories.js +1 -1
- package/lib/components/NavBarSection/NavBarItem.js +3 -14
- package/lib/components/NavBarSection/NavBarItemBody.js +6 -11
- package/lib/components/NavBarSection/NavBarItemButton.js +0 -7
- package/lib/components/NavBarSection/NavBarItemHeader.js +9 -33
- package/lib/components/NavBarSection/NavBarItemLink.js +0 -9
- package/lib/components/NavBarSection/NavBarSection.js +18 -50
- package/lib/hooks/useNavBarPress/useNavBarPress.js +5 -3
- package/lib/types/index.js +1 -0
- package/lib/types/navBar.js +1 -0
- package/package.json +1 -1
@@ -16,17 +16,16 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
|
|
16
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
18
18
|
var _focus = require("@react-aria/focus");
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
20
19
|
var _NavBarContext = require("../../context/NavBarContext");
|
21
20
|
var _useNavBarStyling = _interopRequireDefault(require("../../hooks/useNavBarStyling/useNavBarStyling"));
|
22
21
|
var _useProgressiveState3 = _interopRequireDefault(require("../../hooks/useProgressiveState"));
|
23
|
-
var _isIterable = require("../../utils/devUtils/props/isIterable");
|
24
22
|
var _Box = _interopRequireDefault(require("../Box/Box"));
|
25
23
|
var _react2 = require("@emotion/react");
|
26
24
|
var _excluded = ["isAuto\u0421ollapsible", "defaultSelectedKey", "selectedKey", "setSelectedKey", "hasRestoreFocus", "defaultExpandedKeys", "children", "variant"];
|
27
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
28
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
29
27
|
var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
28
|
+
var _children$;
|
30
29
|
var isAutoСollapsible = props.isAutoСollapsible,
|
31
30
|
defaultSelectedKey = props.defaultSelectedKey,
|
32
31
|
selectedKeyProp = props.selectedKey,
|
@@ -36,7 +35,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
36
35
|
children = props.children,
|
37
36
|
variant = props.variant,
|
38
37
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
39
|
-
var initialExpandedKeys = isAutoСollapsible && defaultExpandedKeys.length ? defaultExpandedKeys[0] : defaultExpandedKeys;
|
38
|
+
var initialExpandedKeys = isAutoСollapsible && (0, _isArray["default"])(defaultExpandedKeys) && defaultExpandedKeys.length ? defaultExpandedKeys[0] : defaultExpandedKeys;
|
40
39
|
var _useState = (0, _react.useState)(initialExpandedKeys),
|
41
40
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
42
41
|
expandedKeys = _useState2[0],
|
@@ -53,7 +52,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
53
52
|
};
|
54
53
|
}) : [{
|
55
54
|
item: children,
|
56
|
-
key: children
|
55
|
+
key: !children ? '' : (_children$ = children[0]) === null || _children$ === void 0 ? void 0 : _children$.key
|
57
56
|
}];
|
58
57
|
var contextValue = (0, _react.useMemo)(function () {
|
59
58
|
return {
|
@@ -74,11 +73,11 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
74
73
|
as: "nav"
|
75
74
|
}, others), items.length ? (0, _react2.jsx)(_focus.FocusScope, {
|
76
75
|
restoreFocus: hasRestoreFocus
|
77
|
-
}, (0, _map["default"])(items).call(items, function (_ref) {
|
76
|
+
}, (0, _map["default"])(items).call(items, function (_ref, index) {
|
78
77
|
var item = _ref.item,
|
79
78
|
key = _ref.key;
|
80
79
|
return (0, _react2.jsx)(FocusableItem, {
|
81
|
-
key: key
|
80
|
+
key: key || "key".concat(index)
|
82
81
|
}, item);
|
83
82
|
})) : null));
|
84
83
|
});
|
@@ -105,26 +104,6 @@ var FocusableItem = function FocusableItem(props) {
|
|
105
104
|
});
|
106
105
|
return childWithFocusHandle;
|
107
106
|
};
|
108
|
-
NavBar.propTypes = {
|
109
|
-
/** Allows only one item to be expanded. */
|
110
|
-
isAutoСollapsible: _propTypes["default"].bool,
|
111
|
-
/** This applies a style to the entire nav tree. the options are default and popup. */
|
112
|
-
variant: _propTypes["default"].oneOf(['default', 'popupNav']),
|
113
|
-
/** Whether or not the focus will return to the previously focused element upon unmount. */
|
114
|
-
hasRestoreFocus: _propTypes["default"].bool,
|
115
|
-
/** The initial selected key in the collection (uncontrolled). */
|
116
|
-
defaultSelectedKey: _propTypes["default"].string,
|
117
|
-
/** The initial expanded keys in the collection (uncontrolled). */
|
118
|
-
defaultExpandedKeys: _isIterable.isIterableProp,
|
119
|
-
/** The selected key in the collection (controlled). */
|
120
|
-
selectedKey: _isIterable.isIterableProp,
|
121
|
-
/**
|
122
|
-
* Callback function that fires when the selected key changes.
|
123
|
-
*
|
124
|
-
* `(selectedKey: String) => void`
|
125
|
-
*/
|
126
|
-
setSelectedKey: _propTypes["default"].func
|
127
|
-
};
|
128
107
|
NavBar.defaultProps = {
|
129
108
|
isAutoСollapsible: false,
|
130
109
|
defaultSelectedKey: '',
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { StoryFn } from '@storybook/react';
|
2
|
+
import { NavBarProps } from '../../types';
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Default: StoryFn<NavBarProps>;
|
6
|
+
export declare const Controlled: StoryFn<NavBarProps>;
|
7
|
+
export declare const AutoCollapse: StoryFn<NavBarProps>;
|
@@ -25,7 +25,7 @@ var _ViewGridPlusOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react
|
|
25
25
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
26
26
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
27
27
|
var _index = require("../../index");
|
28
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks
|
28
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
29
29
|
var _NavBar = _interopRequireDefault(require("./NavBar.mdx"));
|
30
30
|
var _react2 = require("@emotion/react");
|
31
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -0,0 +1,364 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
container: {
|
3
|
+
height: string;
|
4
|
+
width: string;
|
5
|
+
position: string;
|
6
|
+
zIndex: string;
|
7
|
+
top: string;
|
8
|
+
left: string;
|
9
|
+
backgroundColor: string;
|
10
|
+
overflowY: string;
|
11
|
+
};
|
12
|
+
popUpContainer: {
|
13
|
+
minWidth: string;
|
14
|
+
maxWidth: string;
|
15
|
+
width: string;
|
16
|
+
backgroundColor: string;
|
17
|
+
borderRight: string;
|
18
|
+
borderRightColor: string;
|
19
|
+
height: string;
|
20
|
+
position: string;
|
21
|
+
zIndex: string;
|
22
|
+
top: string;
|
23
|
+
left: string;
|
24
|
+
overflowY: string;
|
25
|
+
};
|
26
|
+
itemHeaderContainer: {
|
27
|
+
flexGrow: number;
|
28
|
+
alignItems: string;
|
29
|
+
maxWidth: string;
|
30
|
+
py: string;
|
31
|
+
px: string;
|
32
|
+
cursor: string;
|
33
|
+
minHeight: string;
|
34
|
+
'&.is-selected': {
|
35
|
+
backgroundColor: string;
|
36
|
+
boxShadow: string;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
popUpItemHeaderContainer: {
|
40
|
+
minHeight: string;
|
41
|
+
maxWidth: string;
|
42
|
+
pl: string;
|
43
|
+
pr: string;
|
44
|
+
'&.is-selected': {
|
45
|
+
backgroundColor: string;
|
46
|
+
};
|
47
|
+
flexGrow: number;
|
48
|
+
alignItems: string;
|
49
|
+
py: string;
|
50
|
+
px: string;
|
51
|
+
cursor: string;
|
52
|
+
};
|
53
|
+
popUpItemListItem: {
|
54
|
+
borderBottom: string;
|
55
|
+
};
|
56
|
+
sectionContainer: {
|
57
|
+
pt: string;
|
58
|
+
height: string;
|
59
|
+
maxHeight: string;
|
60
|
+
overflowY: string;
|
61
|
+
'&::-webkit-scrollbar-thumb': {
|
62
|
+
backgroundColor: string;
|
63
|
+
borderRadius: string;
|
64
|
+
};
|
65
|
+
'&::-webkit-scrollbar': {
|
66
|
+
width: number;
|
67
|
+
};
|
68
|
+
'&::-webkit-scrollbar-track': {
|
69
|
+
backgroundColor: string;
|
70
|
+
};
|
71
|
+
scrollbarColor: string;
|
72
|
+
'&:hover': {
|
73
|
+
'&::-webkit-scrollbar-thumb': {
|
74
|
+
backgroundColor: string;
|
75
|
+
borderRadius: string;
|
76
|
+
};
|
77
|
+
'&::-webkit-scrollbar-track': {
|
78
|
+
backgroundColor: string;
|
79
|
+
};
|
80
|
+
scrollbarColor: string;
|
81
|
+
};
|
82
|
+
};
|
83
|
+
popUpSectionContainer: {
|
84
|
+
height: string;
|
85
|
+
maxHeight: string;
|
86
|
+
overflowY: string;
|
87
|
+
'&::-webkit-scrollbar-thumb': {
|
88
|
+
backgroundColor: string;
|
89
|
+
borderRadius: string;
|
90
|
+
};
|
91
|
+
'&::-webkit-scrollbar': {
|
92
|
+
width: number;
|
93
|
+
};
|
94
|
+
'&::-webkit-scrollbar-track': {
|
95
|
+
backgroundColor: string;
|
96
|
+
};
|
97
|
+
scrollbarColor: string;
|
98
|
+
'&:hover': {
|
99
|
+
'&::-webkit-scrollbar-thumb': {
|
100
|
+
backgroundColor: string;
|
101
|
+
borderRadius: string;
|
102
|
+
};
|
103
|
+
'&::-webkit-scrollbar-track': {
|
104
|
+
backgroundColor: string;
|
105
|
+
};
|
106
|
+
scrollbarColor: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
sectionBody: any;
|
110
|
+
sectionButton: {
|
111
|
+
width: string;
|
112
|
+
'&.is-focused': {
|
113
|
+
outline: string;
|
114
|
+
outlineColor: string;
|
115
|
+
};
|
116
|
+
'&.is-hovered': {
|
117
|
+
backgroundColor: string;
|
118
|
+
};
|
119
|
+
'&.is-pressed': {
|
120
|
+
backgroundColor: string;
|
121
|
+
};
|
122
|
+
all: string;
|
123
|
+
display: string;
|
124
|
+
};
|
125
|
+
popUpSectionButton: {
|
126
|
+
width: string;
|
127
|
+
'&.is-focused': {
|
128
|
+
outline: string;
|
129
|
+
outlineColor: string;
|
130
|
+
};
|
131
|
+
'&.is-hovered': {
|
132
|
+
backgroundColor: string;
|
133
|
+
};
|
134
|
+
'&.is-pressed': {
|
135
|
+
backgroundColor: string;
|
136
|
+
color: string;
|
137
|
+
};
|
138
|
+
'&.is-pressed > div > div > svg > path': {
|
139
|
+
fill: string;
|
140
|
+
};
|
141
|
+
all: string;
|
142
|
+
display: string;
|
143
|
+
};
|
144
|
+
itemButton: {
|
145
|
+
textDecoration: string;
|
146
|
+
outline: string;
|
147
|
+
cursor: string;
|
148
|
+
borderRadius: number;
|
149
|
+
backgroundColor: string;
|
150
|
+
paddingTop: string;
|
151
|
+
paddingBottom: string;
|
152
|
+
display: string;
|
153
|
+
color: string;
|
154
|
+
fontSize: string;
|
155
|
+
fontWeight: number;
|
156
|
+
flexGrow: string;
|
157
|
+
width: string;
|
158
|
+
textAlign: string;
|
159
|
+
whiteSpace: string;
|
160
|
+
overflowWrap: string;
|
161
|
+
maxWidth: string;
|
162
|
+
wordWrap: string;
|
163
|
+
wordBreak: string;
|
164
|
+
paddingLeft: string;
|
165
|
+
paddingRight: string;
|
166
|
+
'&.is-focused': {
|
167
|
+
outline: string;
|
168
|
+
outlineColor: string;
|
169
|
+
};
|
170
|
+
'&.is-hovered': {
|
171
|
+
bg: string;
|
172
|
+
};
|
173
|
+
'&.is-selected': {
|
174
|
+
bg: string;
|
175
|
+
boxShadow: string;
|
176
|
+
};
|
177
|
+
'&.is-pressed': {
|
178
|
+
bg: string;
|
179
|
+
};
|
180
|
+
};
|
181
|
+
popUpItemButton: {
|
182
|
+
fontSize: string;
|
183
|
+
px: string;
|
184
|
+
color: string;
|
185
|
+
'&.is-focused': {
|
186
|
+
outline: string;
|
187
|
+
outlineColor: string;
|
188
|
+
outlineOffset: string;
|
189
|
+
};
|
190
|
+
'&.is-selected': {
|
191
|
+
bg: string;
|
192
|
+
color: string;
|
193
|
+
};
|
194
|
+
'&.is-hovered': {
|
195
|
+
bg: string;
|
196
|
+
color: string;
|
197
|
+
};
|
198
|
+
'&.is-pressed': {
|
199
|
+
bg: string;
|
200
|
+
color: string;
|
201
|
+
};
|
202
|
+
textDecoration: string;
|
203
|
+
outline: string;
|
204
|
+
cursor: string;
|
205
|
+
borderRadius: number;
|
206
|
+
backgroundColor: string;
|
207
|
+
paddingTop: string;
|
208
|
+
paddingBottom: string;
|
209
|
+
display: string;
|
210
|
+
fontWeight: number;
|
211
|
+
flexGrow: string;
|
212
|
+
width: string;
|
213
|
+
textAlign: string;
|
214
|
+
whiteSpace: string;
|
215
|
+
overflowWrap: string;
|
216
|
+
maxWidth: string;
|
217
|
+
wordWrap: string;
|
218
|
+
wordBreak: string;
|
219
|
+
paddingLeft: string;
|
220
|
+
paddingRight: string;
|
221
|
+
};
|
222
|
+
subtitle: {
|
223
|
+
ml: string;
|
224
|
+
my: string;
|
225
|
+
fontWeight: number;
|
226
|
+
fontSize: string;
|
227
|
+
color: string;
|
228
|
+
zIndex: string;
|
229
|
+
};
|
230
|
+
headerText: {
|
231
|
+
whiteSpace: string;
|
232
|
+
lineHeight: number;
|
233
|
+
fontSize: string;
|
234
|
+
fontWeight: number;
|
235
|
+
maxWidth: string;
|
236
|
+
color: string;
|
237
|
+
'.is-selected &': {
|
238
|
+
color: string;
|
239
|
+
};
|
240
|
+
display: string;
|
241
|
+
overflowWrap: import("../..").overflowWrap;
|
242
|
+
wordWrap: import("../..").wordWrap;
|
243
|
+
wordBreak: import("../..").wordBreak;
|
244
|
+
};
|
245
|
+
popUpHeaderText: {
|
246
|
+
fontWeight: number;
|
247
|
+
color: string;
|
248
|
+
'.is-pressed &': {
|
249
|
+
color: string;
|
250
|
+
};
|
251
|
+
'.is-selected &': {
|
252
|
+
color: string;
|
253
|
+
};
|
254
|
+
whiteSpace: string;
|
255
|
+
lineHeight: number;
|
256
|
+
fontSize: string;
|
257
|
+
maxWidth: string;
|
258
|
+
display: string;
|
259
|
+
overflowWrap: import("../..").overflowWrap;
|
260
|
+
wordWrap: import("../..").wordWrap;
|
261
|
+
wordBreak: import("../..").wordBreak;
|
262
|
+
};
|
263
|
+
headerNav: {
|
264
|
+
cursor: string;
|
265
|
+
minHeight: string;
|
266
|
+
lineHeight: string;
|
267
|
+
outline: string;
|
268
|
+
display: string;
|
269
|
+
justifyContent: string;
|
270
|
+
flexShrink: number;
|
271
|
+
wordBreak: string;
|
272
|
+
whiteSpace: string;
|
273
|
+
color: string;
|
274
|
+
flexGrow: number;
|
275
|
+
fontWeight: number;
|
276
|
+
fontSize: string;
|
277
|
+
'&.is-focused': {
|
278
|
+
outline: string;
|
279
|
+
boxShadow: string;
|
280
|
+
WebkitBoxShadow: string;
|
281
|
+
MozBoxShadow: string;
|
282
|
+
};
|
283
|
+
'&.is-hovered': {
|
284
|
+
backgroundColor: string;
|
285
|
+
};
|
286
|
+
'&.is-pressed': {
|
287
|
+
backgroundColor: string;
|
288
|
+
};
|
289
|
+
};
|
290
|
+
item: {
|
291
|
+
py: string;
|
292
|
+
px: string;
|
293
|
+
'&.is-selected': {
|
294
|
+
backgroundColor: string;
|
295
|
+
boxShadow: string;
|
296
|
+
};
|
297
|
+
cursor: string;
|
298
|
+
minHeight: string;
|
299
|
+
lineHeight: string;
|
300
|
+
outline: string;
|
301
|
+
display: string;
|
302
|
+
justifyContent: string;
|
303
|
+
flexShrink: number;
|
304
|
+
wordBreak: string;
|
305
|
+
whiteSpace: string;
|
306
|
+
color: string;
|
307
|
+
flexGrow: number;
|
308
|
+
fontWeight: number;
|
309
|
+
fontSize: string;
|
310
|
+
'&.is-focused': {
|
311
|
+
outline: string;
|
312
|
+
boxShadow: string;
|
313
|
+
WebkitBoxShadow: string;
|
314
|
+
MozBoxShadow: string;
|
315
|
+
};
|
316
|
+
'&.is-hovered': {
|
317
|
+
backgroundColor: string;
|
318
|
+
};
|
319
|
+
'&.is-pressed': {
|
320
|
+
backgroundColor: string;
|
321
|
+
};
|
322
|
+
};
|
323
|
+
popUpItem: {
|
324
|
+
py: string;
|
325
|
+
px: string;
|
326
|
+
'&.is-selected': {
|
327
|
+
boxShadow: string;
|
328
|
+
};
|
329
|
+
cursor: string;
|
330
|
+
minHeight: string;
|
331
|
+
lineHeight: string;
|
332
|
+
outline: string;
|
333
|
+
display: string;
|
334
|
+
justifyContent: string;
|
335
|
+
flexShrink: number;
|
336
|
+
wordBreak: string;
|
337
|
+
whiteSpace: string;
|
338
|
+
color: string;
|
339
|
+
flexGrow: number;
|
340
|
+
fontWeight: number;
|
341
|
+
fontSize: string;
|
342
|
+
'&.is-focused': {
|
343
|
+
outline: string;
|
344
|
+
boxShadow: string;
|
345
|
+
WebkitBoxShadow: string;
|
346
|
+
MozBoxShadow: string;
|
347
|
+
};
|
348
|
+
'&.is-hovered': {
|
349
|
+
backgroundColor: string;
|
350
|
+
};
|
351
|
+
'&.is-pressed': {
|
352
|
+
backgroundColor: string;
|
353
|
+
};
|
354
|
+
};
|
355
|
+
navBarItemBody: {
|
356
|
+
alignItems: string;
|
357
|
+
mb: string;
|
358
|
+
};
|
359
|
+
popUpNavBarItemBody: {
|
360
|
+
mb: number;
|
361
|
+
alignItems: string;
|
362
|
+
};
|
363
|
+
};
|
364
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './NavBar';
|
@@ -14,7 +14,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-c
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
15
|
var _reactAria = require("react-aria");
|
16
16
|
var _interactions = require("@react-aria/interactions");
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
18
17
|
var _NavBarContext = require("../../context/NavBarContext");
|
19
18
|
var _hooks = require("../../hooks");
|
20
19
|
var _index = require("../../index");
|
@@ -29,7 +28,7 @@ var NavBarItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
29
28
|
key = props.id,
|
30
29
|
onPressCallback = props.onPress,
|
31
30
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
32
|
-
var navItemRef = (0,
|
31
|
+
var navItemRef = (0, _hooks.useLocalOrForwardRef)(null);
|
33
32
|
|
34
33
|
/* istanbul ignore next */
|
35
34
|
(0, _react.useImperativeHandle)(ref, function () {
|
@@ -98,15 +97,5 @@ var NavBarItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
98
97
|
variant: state.navStyles.navBarItemText
|
99
98
|
}, text)));
|
100
99
|
});
|
101
|
-
NavBarItem.propTypes = {
|
102
|
-
/** Handler that is called when the press is released over the target. */
|
103
|
-
onPress: _propTypes["default"].func,
|
104
|
-
/** The icon to render in between each node. */
|
105
|
-
icon: _propTypes["default"].elementType,
|
106
|
-
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
107
|
-
id: _propTypes["default"].string,
|
108
|
-
/** Text that will render within the component */
|
109
|
-
text: _propTypes["default"].string
|
110
|
-
};
|
111
100
|
var _default = NavBarItem;
|
112
101
|
exports["default"] = _default;
|
@@ -48,28 +48,23 @@ var NavBarItemBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
48
48
|
return (0, _react2.jsx)(_index.Box, {
|
49
49
|
variant: state.navStyles.navBarItemBody,
|
50
50
|
ref: ref
|
51
|
-
}, (0, _map["default"])(_context = item.children).call(_context, renderChild));
|
51
|
+
}, (item === null || item === void 0 ? void 0 : item.children) && (0, _map["default"])(_context = item.children).call(_context, renderChild));
|
52
52
|
});
|
53
53
|
var ChildItemWrapper = function ChildItemWrapper(_ref2) {
|
54
54
|
var children = _ref2.children,
|
55
55
|
_onKeyDown = _ref2.onKeyDown;
|
56
|
-
var childrenKey = children.key || children;
|
56
|
+
var childrenKey = (children === null || children === void 0 ? void 0 : children.key) || children;
|
57
57
|
var _useKeyboard = (0, _interactions.useKeyboard)({
|
58
58
|
onKeyDown: function onKeyDown(e) {
|
59
|
-
return _onKeyDown(e, childrenKey);
|
59
|
+
return _onKeyDown ? _onKeyDown(e, childrenKey) : undefined;
|
60
60
|
}
|
61
61
|
}),
|
62
62
|
keyboardProps = _useKeyboard.keyboardProps;
|
63
63
|
return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
64
64
|
width: "100%"
|
65
|
-
}, keyboardProps
|
66
|
-
|
67
|
-
|
68
|
-
item: _propTypes["default"].shape({
|
69
|
-
children: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])),
|
70
|
-
key: _propTypes["default"].string
|
71
|
-
}),
|
72
|
-
onKeyDown: _propTypes["default"].func
|
65
|
+
}, keyboardProps, {
|
66
|
+
role: "none"
|
67
|
+
}), (0, _react2.jsx)(_react["default"].Fragment, null, ' ', children && children));
|
73
68
|
};
|
74
69
|
ChildItemWrapper.propTypes = {
|
75
70
|
onKeyDown: _propTypes["default"].func
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -9,7 +9,6 @@ exports["default"] = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
12
|
var _NavBarContext = require("../../context/NavBarContext");
|
14
13
|
var _hooks = require("../../hooks");
|
15
14
|
var _index = require("../../index");
|
@@ -40,11 +39,5 @@ var NavBarItemButton = function NavBarItemButton(props) {
|
|
40
39
|
color: isSelected ? 'white' : undefined
|
41
40
|
}, others));
|
42
41
|
};
|
43
|
-
NavBarItemButton.propTypes = {
|
44
|
-
/** Handler that is called when the press is released over the target. */
|
45
|
-
onPress: _propTypes["default"].func,
|
46
|
-
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
47
|
-
id: _propTypes["default"].string.isRequired
|
48
|
-
};
|
49
42
|
var _default = NavBarItemButton;
|
50
43
|
exports["default"] = _default;
|