@pingux/astro 2.166.1-alpha.1 → 2.166.1-alpha.3
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.d.ts +6 -5
- package/lib/cjs/components/Button/Buttons.styles.js +10 -4
- package/lib/cjs/components/SearchNav/MoreItemsPopover.js +2 -2
- package/lib/cjs/components/SearchNav/SearchNav.js +1 -1
- package/lib/cjs/components/SearchNav/SearchNav.stories.js +2 -3
- package/lib/cjs/components/SearchNav/SearchNav.styles.d.ts +5 -3
- package/lib/cjs/components/SearchNav/SearchNav.styles.js +9 -16
- package/lib/cjs/components/SearchNav/SearchNav.test.js +5 -5
- package/lib/cjs/components/Text/Text.styles.js +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.js +1 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +3 -1
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +3 -1
- package/lib/cjs/styles/themes/next-gen/variants/button.js +3 -1
- package/lib/components/Button/Buttons.styles.js +10 -4
- package/lib/components/SearchNav/MoreItemsPopover.js +2 -2
- package/lib/components/SearchNav/SearchNav.js +1 -1
- package/lib/components/SearchNav/SearchNav.stories.js +3 -4
- package/lib/components/SearchNav/SearchNav.styles.js +9 -16
- package/lib/components/SearchNav/SearchNav.test.js +5 -5
- package/lib/components/Text/Text.styles.js +1 -1
- package/lib/index.js +1 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/text.js +1 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/styles/themes/next-gen/variants/button.js +3 -1
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -981,7 +981,9 @@ declare const _default: {
|
|
|
981
981
|
searchNavTabLabel: {
|
|
982
982
|
backgroundColor: string;
|
|
983
983
|
mb: string;
|
|
984
|
-
|
|
984
|
+
px: string;
|
|
985
|
+
pt: string;
|
|
986
|
+
pb: string;
|
|
985
987
|
borderImage: string;
|
|
986
988
|
display: string;
|
|
987
989
|
alignItems: string;
|
|
@@ -990,15 +992,15 @@ declare const _default: {
|
|
|
990
992
|
cursor: string;
|
|
991
993
|
};
|
|
992
994
|
'&.is-focused': {
|
|
993
|
-
|
|
995
|
+
boxShadow: string;
|
|
994
996
|
outline: string;
|
|
995
997
|
outlineColor: string;
|
|
996
998
|
outlineOffset: string;
|
|
999
|
+
borderRadius: string;
|
|
997
1000
|
};
|
|
998
1001
|
whiteSpace: string;
|
|
999
1002
|
fontSize: string;
|
|
1000
1003
|
fontWeight: number;
|
|
1001
|
-
px: string;
|
|
1002
1004
|
lineHeight: string;
|
|
1003
1005
|
color: string;
|
|
1004
1006
|
height: string;
|
|
@@ -1722,9 +1724,8 @@ declare const _default: {
|
|
|
1722
1724
|
marginX?: import("theme-ui").StylePropertyValue<import("csstype").Property.MarginLeft<string | number> | undefined>;
|
|
1723
1725
|
my?: import("theme-ui").StylePropertyValue<import("csstype").Property.MarginTop<string | number> | undefined>;
|
|
1724
1726
|
marginY?: import("theme-ui").StylePropertyValue<import("csstype").Property.MarginTop<string | number> | undefined>;
|
|
1725
|
-
|
|
1727
|
+
p?: import("theme-ui").StylePropertyValue<import("csstype").Property.Padding<string | number> | undefined>;
|
|
1726
1728
|
pr?: import("theme-ui").StylePropertyValue<import("csstype").Property.PaddingRight<string | number> | undefined>;
|
|
1727
|
-
pb?: import("theme-ui").StylePropertyValue<import("csstype").Property.PaddingBottom<string | number> | undefined>;
|
|
1728
1729
|
pl?: import("theme-ui").StylePropertyValue<import("csstype").Property.PaddingLeft<string | number> | undefined>;
|
|
1729
1730
|
paddingX?: import("theme-ui").StylePropertyValue<import("csstype").Property.PaddingLeft<string | number> | undefined>;
|
|
1730
1731
|
py?: import("theme-ui").StylePropertyValue<import("csstype").Property.PaddingTop<string | number> | undefined>;
|
|
@@ -289,8 +289,10 @@ var paginationMenu = _objectSpread(_objectSpread({}, link), {}, {
|
|
|
289
289
|
});
|
|
290
290
|
var tabLabelButton = _objectSpread(_objectSpread({}, _Text.searchNavTabLabel), {}, {
|
|
291
291
|
backgroundColor: 'transparent',
|
|
292
|
-
mb: '
|
|
293
|
-
|
|
292
|
+
mb: '0px',
|
|
293
|
+
px: 'md',
|
|
294
|
+
pt: '10px',
|
|
295
|
+
pb: '9px',
|
|
294
296
|
borderImage: 'none',
|
|
295
297
|
display: 'inline-flex',
|
|
296
298
|
alignItems: 'center',
|
|
@@ -298,9 +300,13 @@ var tabLabelButton = _objectSpread(_objectSpread({}, _Text.searchNavTabLabel), {
|
|
|
298
300
|
color: 'active',
|
|
299
301
|
cursor: 'pointer'
|
|
300
302
|
},
|
|
301
|
-
'&.is-focused':
|
|
303
|
+
'&.is-focused': {
|
|
304
|
+
boxShadow: 'none',
|
|
305
|
+
outline: '3px solid',
|
|
306
|
+
outlineColor: 'active',
|
|
307
|
+
outlineOffset: '1px',
|
|
302
308
|
borderRadius: '4px'
|
|
303
|
-
}
|
|
309
|
+
}
|
|
304
310
|
});
|
|
305
311
|
var _default = exports["default"] = {
|
|
306
312
|
colorBlock: colorBlock,
|
|
@@ -40,9 +40,9 @@ var MoreItemsPopover = function MoreItemsPopover(props) {
|
|
|
40
40
|
return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
|
41
41
|
role: "listitem",
|
|
42
42
|
variant: "searchNav.tab",
|
|
43
|
+
pt: "0px",
|
|
43
44
|
isRow: true,
|
|
44
|
-
alignItems: "center"
|
|
45
|
-
ml: "sm"
|
|
45
|
+
alignItems: "center"
|
|
46
46
|
}, tabProps), (0, _react2.jsx)(_index.PopoverMenu, (0, _extends2["default"])({}, popoverProps, {
|
|
47
47
|
isOpen: isOpen,
|
|
48
48
|
onOpenChange: setIsOpen
|
|
@@ -27,7 +27,7 @@ var _SearchNavTab = _interopRequireDefault(require("./SearchNavTab"));
|
|
|
27
27
|
var _react2 = require("@emotion/react");
|
|
28
28
|
var _excluded = ["defaultSelectedKey", "items", "labelProps", "moreButtonText", "onSelectionChange", "onOpenChange", "popoverButtonProps", "popoverMenuProps", "popoverProps", "rowProps", "selectedKey", "setSelectedKey", "tabProps"];
|
|
29
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
|
-
var TAB_MARGIN_WIDTH =
|
|
30
|
+
var TAB_MARGIN_WIDTH = 32; // Example constant value
|
|
31
31
|
var MORE_BUTTON_WIDTH = 60;
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -13,11 +13,10 @@ var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
|
|
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _index = require("../../index");
|
|
16
|
-
var _SearchNav = _interopRequireDefault(require("./SearchNav"));
|
|
17
16
|
var _react2 = require("@emotion/react");
|
|
18
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
18
|
var _default = exports["default"] = {
|
|
20
|
-
title: 'Components/
|
|
19
|
+
title: 'Components/NavList'
|
|
21
20
|
};
|
|
22
21
|
var items = [{
|
|
23
22
|
text: 'Overview',
|
|
@@ -59,7 +58,7 @@ var Default = exports.Default = function Default() {
|
|
|
59
58
|
};
|
|
60
59
|
return (0, _react2.jsx)(_index.Box, {
|
|
61
60
|
maxWidth: "600px"
|
|
62
|
-
}, (0, _react2.jsx)(
|
|
61
|
+
}, (0, _react2.jsx)(_index.NavList, {
|
|
63
62
|
items: items,
|
|
64
63
|
selectedKey: selectedKey,
|
|
65
64
|
setSelectedKey: function setSelectedKey(e) {
|
|
@@ -10,12 +10,14 @@ declare const _default: {
|
|
|
10
10
|
position: string;
|
|
11
11
|
zIndex: string;
|
|
12
12
|
'&.is-focused': {
|
|
13
|
+
boxShadow: string;
|
|
14
|
+
outline: string;
|
|
15
|
+
outlineColor: string;
|
|
16
|
+
outlineOffset: string;
|
|
13
17
|
'& > span': {
|
|
14
|
-
borderRadius: string;
|
|
15
18
|
outline: string;
|
|
16
|
-
outlineColor: string;
|
|
17
|
-
outlineOffset: string;
|
|
18
19
|
};
|
|
20
|
+
borderRadius: string;
|
|
19
21
|
};
|
|
20
22
|
'&.is-disabled': {
|
|
21
23
|
cursor: string;
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
5
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
8
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
9
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
10
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
12
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
13
5
|
value: true
|
|
14
6
|
});
|
|
15
7
|
exports["default"] = void 0;
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
17
|
-
var _Buttons = require("../Button/Buttons.styles");
|
|
18
|
-
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
8
|
var tab = {
|
|
21
|
-
pt: '
|
|
9
|
+
pt: 'sm',
|
|
22
10
|
cursor: 'pointer',
|
|
23
11
|
alignItems: 'center',
|
|
24
12
|
display: 'inline-flex',
|
|
@@ -28,9 +16,14 @@ var tab = {
|
|
|
28
16
|
position: 'relative',
|
|
29
17
|
zIndex: '2',
|
|
30
18
|
'&.is-focused': {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
boxShadow: 'none',
|
|
20
|
+
outline: '3px solid',
|
|
21
|
+
outlineColor: 'active',
|
|
22
|
+
outlineOffset: '1px',
|
|
23
|
+
'& > span': {
|
|
24
|
+
outline: 'none'
|
|
25
|
+
},
|
|
26
|
+
borderRadius: '4px'
|
|
34
27
|
},
|
|
35
28
|
'&.is-disabled': {
|
|
36
29
|
cursor: 'default'
|
|
@@ -194,7 +194,7 @@ describe('Pure Functions Tests', function () {
|
|
|
194
194
|
});
|
|
195
195
|
it('breaks when adding an item and the required space for the "More" button exceeds container width', function () {
|
|
196
196
|
// Set container width to only allow the first two items and the "More" button
|
|
197
|
-
var containerWidthPartial =
|
|
197
|
+
var containerWidthPartial = 334;
|
|
198
198
|
var visibleCount = (0, _SearchNav.calculateVisibleCount)(containerWidthPartial, moreButtonWidth, mockOrderedItems, mockItemWidths);
|
|
199
199
|
// It should fit the first two, but break on the third, so count should be 2.
|
|
200
200
|
expect(visibleCount).toBe(2);
|
|
@@ -334,7 +334,7 @@ test('hidden tab selection updates key, content, and triggers swap', /*#__PURE__
|
|
|
334
334
|
|
|
335
335
|
// We expect 2 visible tabs: Tab 1 ('Overview') and the newly swapped-in tab ('Resources')
|
|
336
336
|
// We expect the 'More' button to be the third listitem
|
|
337
|
-
expect(visibleTabs.length).toBe(
|
|
337
|
+
expect(visibleTabs.length).toBe(1);
|
|
338
338
|
});
|
|
339
339
|
case 14:
|
|
340
340
|
_context3.next = 16;
|
|
@@ -361,7 +361,7 @@ test('resizing container to be very small hides all but one tab', /*#__PURE__*/(
|
|
|
361
361
|
while (1) switch (_context4.prev = _context4.next) {
|
|
362
362
|
case 0:
|
|
363
363
|
// Start large (mockContainerWidth = 1000)
|
|
364
|
-
mockContainerWidth =
|
|
364
|
+
mockContainerWidth = 1200;
|
|
365
365
|
getComponent({
|
|
366
366
|
items: items
|
|
367
367
|
});
|
|
@@ -423,7 +423,7 @@ test('resizing container to be very small hides all but one tab', /*#__PURE__*/(
|
|
|
423
423
|
expect(visibleListItems.length).toBe(2);
|
|
424
424
|
});
|
|
425
425
|
case 15:
|
|
426
|
-
mockContainerWidth =
|
|
426
|
+
mockContainerWidth = 628;
|
|
427
427
|
(0, _testWrapper.act)(function () {
|
|
428
428
|
if (resizeObserverCallback) {
|
|
429
429
|
resizeObserverCallback([{
|
|
@@ -476,7 +476,7 @@ test('recalculates visible items when More button causes an item to be hidden',
|
|
|
476
476
|
while (1) switch (_context5.prev = _context5.next) {
|
|
477
477
|
case 0:
|
|
478
478
|
// Setup: Container wide enough for 3 tabs, but NOT 3 tabs + More button.
|
|
479
|
-
mockContainerWidth =
|
|
479
|
+
mockContainerWidth = 420; // Max allowed width
|
|
480
480
|
|
|
481
481
|
// We ensure the mock returns 100 for items and 60 for the More button.
|
|
482
482
|
offsetWidthMock.mockImplementation(function () {
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ export * from './components/ScrollBox';
|
|
|
170
170
|
export { default as SearchField } from './components/SearchField';
|
|
171
171
|
export * from './components/SearchField';
|
|
172
172
|
export { default as SearchNav } from './components/SearchNav';
|
|
173
|
+
export { default as NavList } from './components/SearchNav';
|
|
173
174
|
export * from './components/SearchNav';
|
|
174
175
|
export { default as SelectField } from './components/SelectField';
|
|
175
176
|
export * from './components/SelectField';
|
package/lib/cjs/index.js
CHANGED
|
@@ -126,6 +126,7 @@ var _exportNames = {
|
|
|
126
126
|
ScrollBox: true,
|
|
127
127
|
SearchField: true,
|
|
128
128
|
SearchNav: true,
|
|
129
|
+
NavList: true,
|
|
129
130
|
SelectField: true,
|
|
130
131
|
Separator: true,
|
|
131
132
|
ServerErrorBoundary: true,
|
|
@@ -669,6 +670,12 @@ _Object$defineProperty(exports, "NavBarSection", {
|
|
|
669
670
|
return _NavBarSection["default"];
|
|
670
671
|
}
|
|
671
672
|
});
|
|
673
|
+
_Object$defineProperty(exports, "NavList", {
|
|
674
|
+
enumerable: true,
|
|
675
|
+
get: function get() {
|
|
676
|
+
return _SearchNav["default"];
|
|
677
|
+
}
|
|
678
|
+
});
|
|
672
679
|
_Object$defineProperty(exports, "NavSideBar", {
|
|
673
680
|
enumerable: true,
|
|
674
681
|
get: function get() {
|
|
@@ -5,7 +5,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.nextGenOnlyComponents = exports["default"] = exports.componentSpecificNextGenBlacklist = exports.astroBlacklistStory = void 0;
|
|
8
|
-
var nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', '
|
|
8
|
+
var nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavList', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', 'SelectField', 'Skeleton', 'SliderField', 'Stepper', 'Sticker Sheet', 'SwitchField', 'StatusIcon', 'Table', 'TableBase', 'Tabs', 'Text', 'TextAreaField', 'TextField', 'TooltipTrigger', 'ArrayField', 'ColorField', 'LinkSelectField', 'NumberField', 'SwitchField', 'Base Components', 'SliderField', 'ServerErrorBoundary', 'Avatar', 'Box', 'TimeField'];
|
|
9
9
|
var componentSpecificNextGenBlacklist = exports.componentSpecificNextGenBlacklist = {
|
|
10
10
|
AstroProvider: ['Default', 'With Custom Theme Override'],
|
|
11
11
|
Messages: ['Customization'],
|
|
@@ -282,8 +282,10 @@ var paginationMenu = _objectSpread(_objectSpread({}, link), {}, {
|
|
|
282
282
|
});
|
|
283
283
|
var tabLabelButton = _objectSpread(_objectSpread({}, searchNavTabLabel), {}, {
|
|
284
284
|
backgroundColor: 'transparent',
|
|
285
|
-
mb: '
|
|
286
|
-
|
|
285
|
+
mb: '0px',
|
|
286
|
+
px: 'md',
|
|
287
|
+
pt: '10px',
|
|
288
|
+
pb: '9px',
|
|
287
289
|
borderImage: 'none',
|
|
288
290
|
display: 'inline-flex',
|
|
289
291
|
alignItems: 'center',
|
|
@@ -291,9 +293,13 @@ var tabLabelButton = _objectSpread(_objectSpread({}, searchNavTabLabel), {}, {
|
|
|
291
293
|
color: 'active',
|
|
292
294
|
cursor: 'pointer'
|
|
293
295
|
},
|
|
294
|
-
'&.is-focused':
|
|
296
|
+
'&.is-focused': {
|
|
297
|
+
boxShadow: 'none',
|
|
298
|
+
outline: '3px solid',
|
|
299
|
+
outlineColor: 'active',
|
|
300
|
+
outlineOffset: '1px',
|
|
295
301
|
borderRadius: '4px'
|
|
296
|
-
}
|
|
302
|
+
}
|
|
297
303
|
});
|
|
298
304
|
export default {
|
|
299
305
|
colorBlock: colorBlock,
|
|
@@ -28,9 +28,9 @@ var MoreItemsPopover = function MoreItemsPopover(props) {
|
|
|
28
28
|
return ___EmotionJSX(Box, _extends({
|
|
29
29
|
role: "listitem",
|
|
30
30
|
variant: "searchNav.tab",
|
|
31
|
+
pt: "0px",
|
|
31
32
|
isRow: true,
|
|
32
|
-
alignItems: "center"
|
|
33
|
-
ml: "sm"
|
|
33
|
+
alignItems: "center"
|
|
34
34
|
}, tabProps), ___EmotionJSX(PopoverMenu, _extends({}, popoverProps, {
|
|
35
35
|
isOpen: isOpen,
|
|
36
36
|
onOpenChange: setIsOpen
|
|
@@ -15,7 +15,7 @@ import { Box, Text } from '../../index';
|
|
|
15
15
|
import MoreItemsPopover from './MoreItemsPopover';
|
|
16
16
|
import SearchNavTab from './SearchNavTab';
|
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
|
-
var TAB_MARGIN_WIDTH =
|
|
18
|
+
var TAB_MARGIN_WIDTH = 32; // Example constant value
|
|
19
19
|
var MORE_BUTTON_WIDTH = 60;
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
2
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import { Box, Text } from '../../index';
|
|
5
|
-
import SearchNav from './SearchNav';
|
|
4
|
+
import { Box, NavList, Text } from '../../index';
|
|
6
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
6
|
export default {
|
|
8
|
-
title: 'Components/
|
|
7
|
+
title: 'Components/NavList'
|
|
9
8
|
};
|
|
10
9
|
var items = [{
|
|
11
10
|
text: 'Overview',
|
|
@@ -47,7 +46,7 @@ export var Default = function Default() {
|
|
|
47
46
|
};
|
|
48
47
|
return ___EmotionJSX(Box, {
|
|
49
48
|
maxWidth: "600px"
|
|
50
|
-
}, ___EmotionJSX(
|
|
49
|
+
}, ___EmotionJSX(NavList, {
|
|
51
50
|
items: items,
|
|
52
51
|
selectedKey: selectedKey,
|
|
53
52
|
setSelectedKey: function setSelectedKey(e) {
|
|
@@ -1,17 +1,5 @@
|
|
|
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
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
10
|
-
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
import { defaultFocus } from '../Button/Buttons.styles';
|
|
13
1
|
var tab = {
|
|
14
|
-
pt: '
|
|
2
|
+
pt: 'sm',
|
|
15
3
|
cursor: 'pointer',
|
|
16
4
|
alignItems: 'center',
|
|
17
5
|
display: 'inline-flex',
|
|
@@ -21,9 +9,14 @@ var tab = {
|
|
|
21
9
|
position: 'relative',
|
|
22
10
|
zIndex: '2',
|
|
23
11
|
'&.is-focused': {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
boxShadow: 'none',
|
|
13
|
+
outline: '3px solid',
|
|
14
|
+
outlineColor: 'active',
|
|
15
|
+
outlineOffset: '1px',
|
|
16
|
+
'& > span': {
|
|
17
|
+
outline: 'none'
|
|
18
|
+
},
|
|
19
|
+
borderRadius: '4px'
|
|
27
20
|
},
|
|
28
21
|
'&.is-disabled': {
|
|
29
22
|
cursor: 'default'
|
|
@@ -186,7 +186,7 @@ describe('Pure Functions Tests', function () {
|
|
|
186
186
|
});
|
|
187
187
|
it('breaks when adding an item and the required space for the "More" button exceeds container width', function () {
|
|
188
188
|
// Set container width to only allow the first two items and the "More" button
|
|
189
|
-
var containerWidthPartial =
|
|
189
|
+
var containerWidthPartial = 334;
|
|
190
190
|
var visibleCount = calculateVisibleCount(containerWidthPartial, moreButtonWidth, mockOrderedItems, mockItemWidths);
|
|
191
191
|
// It should fit the first two, but break on the third, so count should be 2.
|
|
192
192
|
expect(visibleCount).toBe(2);
|
|
@@ -326,7 +326,7 @@ test('hidden tab selection updates key, content, and triggers swap', /*#__PURE__
|
|
|
326
326
|
|
|
327
327
|
// We expect 2 visible tabs: Tab 1 ('Overview') and the newly swapped-in tab ('Resources')
|
|
328
328
|
// We expect the 'More' button to be the third listitem
|
|
329
|
-
expect(visibleTabs.length).toBe(
|
|
329
|
+
expect(visibleTabs.length).toBe(1);
|
|
330
330
|
});
|
|
331
331
|
case 14:
|
|
332
332
|
_context3.next = 16;
|
|
@@ -353,7 +353,7 @@ test('resizing container to be very small hides all but one tab', /*#__PURE__*/_
|
|
|
353
353
|
while (1) switch (_context4.prev = _context4.next) {
|
|
354
354
|
case 0:
|
|
355
355
|
// Start large (mockContainerWidth = 1000)
|
|
356
|
-
mockContainerWidth =
|
|
356
|
+
mockContainerWidth = 1200;
|
|
357
357
|
getComponent({
|
|
358
358
|
items: items
|
|
359
359
|
});
|
|
@@ -415,7 +415,7 @@ test('resizing container to be very small hides all but one tab', /*#__PURE__*/_
|
|
|
415
415
|
expect(visibleListItems.length).toBe(2);
|
|
416
416
|
});
|
|
417
417
|
case 15:
|
|
418
|
-
mockContainerWidth =
|
|
418
|
+
mockContainerWidth = 628;
|
|
419
419
|
act(function () {
|
|
420
420
|
if (resizeObserverCallback) {
|
|
421
421
|
resizeObserverCallback([{
|
|
@@ -468,7 +468,7 @@ test('recalculates visible items when More button causes an item to be hidden',
|
|
|
468
468
|
while (1) switch (_context5.prev = _context5.next) {
|
|
469
469
|
case 0:
|
|
470
470
|
// Setup: Container wide enough for 3 tabs, but NOT 3 tabs + More button.
|
|
471
|
-
mockContainerWidth =
|
|
471
|
+
mockContainerWidth = 420; // Max allowed width
|
|
472
472
|
|
|
473
473
|
// We ensure the mock returns 100 for items and 60 for the More button.
|
|
474
474
|
offsetWidthMock.mockImplementation(function () {
|
package/lib/index.js
CHANGED
|
@@ -174,6 +174,7 @@ export * from './components/ScrollBox';
|
|
|
174
174
|
export { default as SearchField } from './components/SearchField';
|
|
175
175
|
export * from './components/SearchField';
|
|
176
176
|
export { default as SearchNav } from './components/SearchNav';
|
|
177
|
+
export { default as NavList } from './components/SearchNav';
|
|
177
178
|
export * from './components/SearchNav';
|
|
178
179
|
export { default as SelectField } from './components/SelectField';
|
|
179
180
|
export * from './components/SelectField';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', '
|
|
1
|
+
var nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavList', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', 'SelectField', 'Skeleton', 'SliderField', 'Stepper', 'Sticker Sheet', 'SwitchField', 'StatusIcon', 'Table', 'TableBase', 'Tabs', 'Text', 'TextAreaField', 'TextField', 'TooltipTrigger', 'ArrayField', 'ColorField', 'LinkSelectField', 'NumberField', 'SwitchField', 'Base Components', 'SliderField', 'ServerErrorBoundary', 'Avatar', 'Box', 'TimeField'];
|
|
2
2
|
export var componentSpecificNextGenBlacklist = {
|
|
3
3
|
AstroProvider: ['Default', 'With Custom Theme Override'],
|
|
4
4
|
Messages: ['Customization'],
|