@pingux/astro 1.40.0 → 1.40.1-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/{Bulletin/Bulletin.js → Callout/Callout.js} +26 -26
- package/lib/cjs/components/{Bulletin/Bulletin.stories.js → Callout/Callout.stories.js} +11 -13
- package/lib/cjs/components/{Bulletin/Bulletin.test.js → Callout/Callout.test.js} +6 -6
- package/lib/cjs/components/{Bulletin → Callout}/index.js +2 -2
- package/lib/cjs/components/CopyText/CopyText.js +1 -1
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +7 -8
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +55 -14
- package/lib/cjs/index.js +13 -5
- package/lib/cjs/styles/variants/boxes.js +2 -1
- package/lib/cjs/styles/variants/{bulletin.js → callout.js} +0 -0
- package/lib/cjs/styles/variants/variants.js +17 -18
- package/lib/components/{Bulletin/Bulletin.js → Callout/Callout.js} +24 -24
- package/lib/components/{Bulletin/Bulletin.stories.js → Callout/Callout.stories.js} +12 -13
- package/lib/components/{Bulletin/Bulletin.test.js → Callout/Callout.test.js} +6 -6
- package/lib/components/Callout/index.js +1 -0
- package/lib/components/CopyText/CopyText.js +1 -1
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +8 -8
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +52 -15
- package/lib/index.js +3 -2
- package/lib/styles/variants/boxes.js +2 -1
- package/lib/styles/variants/{bulletin.js → callout.js} +0 -0
- package/lib/styles/variants/variants.js +13 -14
- package/package.json +1 -1
- package/NOTICE.html +0 -4707
- package/lib/components/Bulletin/index.js +0 -1
@@ -8,7 +8,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports["default"] = exports.
|
11
|
+
exports["default"] = exports.CALLOUT_TEST_ID = void 0;
|
12
12
|
|
13
13
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
14
14
|
|
@@ -32,62 +32,62 @@ var _react2 = require("@emotion/react");
|
|
32
32
|
|
33
33
|
var _excluded = ["children", "status"];
|
34
34
|
|
35
|
-
var
|
35
|
+
var _calloutProps;
|
36
36
|
|
37
|
-
var
|
38
|
-
exports.
|
39
|
-
var
|
37
|
+
var CALLOUT_TEST_ID = 'CalloutTestId';
|
38
|
+
exports.CALLOUT_TEST_ID = CALLOUT_TEST_ID;
|
39
|
+
var calloutProps = (_calloutProps = {}, (0, _defineProperty2["default"])(_calloutProps, _statuses["default"].DEFAULT, {
|
40
40
|
color: 'text.secondary',
|
41
|
-
variant: '
|
42
|
-
}), (0, _defineProperty2["default"])(
|
41
|
+
variant: 'callout.base'
|
42
|
+
}), (0, _defineProperty2["default"])(_calloutProps, _statuses["default"].ERROR, {
|
43
43
|
color: 'critical.bright',
|
44
|
-
variant: '
|
45
|
-
}), (0, _defineProperty2["default"])(
|
44
|
+
variant: 'callout.error'
|
45
|
+
}), (0, _defineProperty2["default"])(_calloutProps, _statuses["default"].SUCCESS, {
|
46
46
|
color: 'success.bright',
|
47
|
-
variant: '
|
48
|
-
}), (0, _defineProperty2["default"])(
|
47
|
+
variant: 'callout.success'
|
48
|
+
}), (0, _defineProperty2["default"])(_calloutProps, _statuses["default"].WARNING, {
|
49
49
|
color: 'warning.bright',
|
50
|
-
variant: '
|
51
|
-
}),
|
50
|
+
variant: 'callout.warning'
|
51
|
+
}), _calloutProps);
|
52
52
|
var defaultIconProps = {
|
53
53
|
mr: 'md',
|
54
54
|
ml: 'md',
|
55
55
|
size: 'md'
|
56
56
|
};
|
57
57
|
/**
|
58
|
-
*
|
59
|
-
that should be placed at the top of panels or above related content. If the
|
58
|
+
*Callout is composed of the Box, Icon, and Text components. It's a persistent component
|
59
|
+
that should be placed at the top of panels or above related content. If the Callouts
|
60
60
|
status is error or warning, the text should include a direct link to instructions on resolving the
|
61
61
|
issue or error.
|
62
62
|
*
|
63
|
-
*Please note,
|
64
|
-
recommended if you need to interrupt and notify users of successful/failed actions
|
65
|
-
give warnings of unexpected events.
|
63
|
+
*Please note, Callout is a static component, the [Messages](./?path=/docs/components-messages)
|
64
|
+
component is recommended if you need to interrupt and notify users of successful/failed actions
|
65
|
+
or give warnings of unexpected events.
|
66
66
|
*/
|
67
67
|
|
68
|
-
var
|
68
|
+
var Callout = function Callout(_ref) {
|
69
69
|
var children = _ref.children,
|
70
70
|
status = _ref.status,
|
71
71
|
others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
72
72
|
return (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
|
73
|
-
"data-testid":
|
73
|
+
"data-testid": CALLOUT_TEST_ID,
|
74
74
|
isRow: true,
|
75
75
|
role: "note",
|
76
|
-
variant:
|
76
|
+
variant: calloutProps[status].variant
|
77
77
|
}, others), (0, _react2.jsx)(_NoticeIcon.NoticeIcon, (0, _extends2["default"])({
|
78
|
-
color:
|
78
|
+
color: calloutProps[status].color,
|
79
79
|
status: status,
|
80
80
|
"aria-label": "".concat(status, "-icon")
|
81
81
|
}, defaultIconProps)), children);
|
82
82
|
};
|
83
83
|
|
84
|
-
|
84
|
+
Callout.propTypes = {
|
85
85
|
/** Determines the icon and color */
|
86
86
|
status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"]))
|
87
87
|
};
|
88
|
-
|
88
|
+
Callout.defaultProps = {
|
89
89
|
status: _statuses["default"].DEFAULT
|
90
90
|
};
|
91
|
-
|
92
|
-
var _default =
|
91
|
+
Callout.displayName = 'Callout';
|
92
|
+
var _default = Callout;
|
93
93
|
exports["default"] = _default;
|
@@ -18,13 +18,11 @@ var _ = require("../..");
|
|
18
18
|
|
19
19
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
20
20
|
|
21
|
-
var _Bulletin = _interopRequireDefault(require("./Bulletin"));
|
22
|
-
|
23
21
|
var _react2 = require("@emotion/react");
|
24
22
|
|
25
23
|
var _default = {
|
26
|
-
title: '
|
27
|
-
component:
|
24
|
+
title: 'Components/Callout',
|
25
|
+
component: _.Callout,
|
28
26
|
argTypes: {
|
29
27
|
status: {
|
30
28
|
control: {
|
@@ -38,10 +36,10 @@ var _default = {
|
|
38
36
|
exports["default"] = _default;
|
39
37
|
|
40
38
|
var Default = function Default(args) {
|
41
|
-
return (0, _react2.jsx)(
|
39
|
+
return (0, _react2.jsx)(_.Callout, args, (0, _react2.jsx)(_.Text, null, "You should be aware of this. It might be good or bad, I don\u2019t know. You may already be aware of it, but I want to be sure", (0, _react2.jsx)(_.Link, {
|
42
40
|
href: "https://pingidentity.com",
|
43
41
|
target: "_blank",
|
44
|
-
"aria-label": "".concat(_statuses["default"].DEFAULT, "-
|
42
|
+
"aria-label": "".concat(_statuses["default"].DEFAULT, "-callout"),
|
45
43
|
variant: "app"
|
46
44
|
}, " Read More")));
|
47
45
|
};
|
@@ -49,12 +47,12 @@ var Default = function Default(args) {
|
|
49
47
|
exports.Default = Default;
|
50
48
|
|
51
49
|
var ErrorStatus = function ErrorStatus() {
|
52
|
-
return (0, _react2.jsx)(
|
50
|
+
return (0, _react2.jsx)(_.Callout, {
|
53
51
|
status: _statuses["default"].ERROR
|
54
52
|
}, (0, _react2.jsx)(_.Text, null, "You\u2019ve got problems. Allow me to tell you about them in some detail so that you can address them", (0, _react2.jsx)(_.Link, {
|
55
53
|
href: "https://pingidentity.com",
|
56
54
|
target: "_blank",
|
57
|
-
"aria-label": "".concat(_statuses["default"].ERROR, "-
|
55
|
+
"aria-label": "".concat(_statuses["default"].ERROR, "-callout"),
|
58
56
|
variant: "app"
|
59
57
|
}, " Read More")));
|
60
58
|
}; // Avoiding using Error as the function name due to it being a JS built-in method
|
@@ -64,12 +62,12 @@ exports.ErrorStatus = ErrorStatus;
|
|
64
62
|
ErrorStatus.storyName = 'Error';
|
65
63
|
|
66
64
|
var Success = function Success() {
|
67
|
-
return (0, _react2.jsx)(
|
65
|
+
return (0, _react2.jsx)(_.Callout, {
|
68
66
|
status: _statuses["default"].SUCCESS
|
69
67
|
}, (0, _react2.jsx)(_.Text, null, "It Worked! Maybe there is something else related to it working that I need to explain", (0, _react2.jsx)(_.Link, {
|
70
68
|
href: "https://pingidentity.com",
|
71
69
|
target: "_blank",
|
72
|
-
"aria-label": "".concat(_statuses["default"].SUCCESS, "-
|
70
|
+
"aria-label": "".concat(_statuses["default"].SUCCESS, "-callout"),
|
73
71
|
variant: "app"
|
74
72
|
}, " Read More")));
|
75
73
|
};
|
@@ -77,12 +75,12 @@ var Success = function Success() {
|
|
77
75
|
exports.Success = Success;
|
78
76
|
|
79
77
|
var Warning = function Warning() {
|
80
|
-
return (0, _react2.jsx)(
|
78
|
+
return (0, _react2.jsx)(_.Callout, {
|
81
79
|
status: _statuses["default"].WARNING
|
82
|
-
}, (0, _react2.jsx)(_.Text, null, "You\u2019ve got issues. Allow me to tell you about them in some detail so that you can address them. I\u2019ll continue to type enough text to demonstrate that the
|
80
|
+
}, (0, _react2.jsx)(_.Text, null, "You\u2019ve got issues. Allow me to tell you about them in some detail so that you can address them. I\u2019ll continue to type enough text to demonstrate that the Callout box will grow in height with the content", (0, _react2.jsx)(_.Link, {
|
83
81
|
href: "https://pingidentity.com",
|
84
82
|
target: "_blank",
|
85
|
-
"aria-label": "".concat(_statuses["default"].WARNING, "-
|
83
|
+
"aria-label": "".concat(_statuses["default"].WARNING, "-callout"),
|
86
84
|
variant: "app"
|
87
85
|
}, " Read More")));
|
88
86
|
};
|
@@ -22,7 +22,7 @@ var _testWrapper = require("../../utils/testUtils/testWrapper");
|
|
22
22
|
|
23
23
|
var _NoticeIcon = require("../Icon/NoticeIcon");
|
24
24
|
|
25
|
-
var
|
25
|
+
var _Callout = _interopRequireWildcard(require("./Callout"));
|
26
26
|
|
27
27
|
var _react3 = require("@emotion/react");
|
28
28
|
|
@@ -37,10 +37,10 @@ var testColors = (_testColors = {}, (0, _defineProperty2["default"])(_testColors
|
|
37
37
|
|
38
38
|
var getComponent = function getComponent() {
|
39
39
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
40
|
-
return (0, _testWrapper.render)((0, _react3.jsx)(
|
40
|
+
return (0, _testWrapper.render)((0, _react3.jsx)(_Callout["default"], props, TEST_TEXT));
|
41
41
|
};
|
42
42
|
|
43
|
-
describe('
|
43
|
+
describe('Callout', function () {
|
44
44
|
test('renders', function () {
|
45
45
|
getComponent();
|
46
46
|
|
@@ -48,15 +48,15 @@ describe('Bulletin', function () {
|
|
48
48
|
});
|
49
49
|
test('renders the default color', function () {
|
50
50
|
getComponent();
|
51
|
-
expect(_react2.screen.getByTestId(
|
51
|
+
expect(_react2.screen.getByTestId(_Callout.CALLOUT_TEST_ID)).toHaveStyle({
|
52
52
|
'border-color': testColors[_statuses["default"].DEFAULT]
|
53
53
|
});
|
54
54
|
});
|
55
|
-
test.each([[_statuses["default"].DEFAULT, testColors[_statuses["default"].DEFAULT]], [_statuses["default"].ERROR, testColors[_statuses["default"].ERROR]], [_statuses["default"].SUCCESS, testColors[_statuses["default"].SUCCESS]], [_statuses["default"].WARNING, testColors[_statuses["default"].WARNING]]])('when given status %s it renders
|
55
|
+
test.each([[_statuses["default"].DEFAULT, testColors[_statuses["default"].DEFAULT]], [_statuses["default"].ERROR, testColors[_statuses["default"].ERROR]], [_statuses["default"].SUCCESS, testColors[_statuses["default"].SUCCESS]], [_statuses["default"].WARNING, testColors[_statuses["default"].WARNING]]])('when given status %s it renders Callout with color %s', function (status, expected) {
|
56
56
|
getComponent({
|
57
57
|
status: status
|
58
58
|
});
|
59
|
-
expect(_react2.screen.getByTestId(
|
59
|
+
expect(_react2.screen.getByTestId(_Callout.CALLOUT_TEST_ID)).toHaveStyle({
|
60
60
|
'border-color': expected
|
61
61
|
});
|
62
62
|
});
|
@@ -11,8 +11,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
11
11
|
_Object$defineProperty(exports, "default", {
|
12
12
|
enumerable: true,
|
13
13
|
get: function get() {
|
14
|
-
return
|
14
|
+
return _Callout["default"];
|
15
15
|
}
|
16
16
|
});
|
17
17
|
|
18
|
-
var
|
18
|
+
var _Callout = _interopRequireDefault(require("./Callout"));
|
@@ -186,7 +186,7 @@ var CopyText = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
186
186
|
ref: pressableRef
|
187
187
|
}, (0, _utils.mergeProps)(hoverProps, pressableProps), {
|
188
188
|
sx: {
|
189
|
-
width: '
|
189
|
+
width: 'fit-content'
|
190
190
|
}
|
191
191
|
}), (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
192
192
|
ref: ref,
|
@@ -145,22 +145,21 @@ var EnvironmentBreadcrumb = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
145
145
|
var filterNodesWithChildren = function filterNodesWithChildren(iterableNode) {
|
146
146
|
var nodeArr = (0, _from["default"])(iterableNode); // with this function we are filtering child items if they have sections
|
147
147
|
// we can't filter items because if it would be a section - we can't change childNodes
|
148
|
-
// eslint-disable-next-line array-callback-return,consistent-return
|
149
148
|
|
150
149
|
var filteredSections = (0, _map["default"])(nodeArr).call(nodeArr, function f(nodeItem) {
|
150
|
+
var _context;
|
151
|
+
|
151
152
|
if ((nodeItem === null || nodeItem === void 0 ? void 0 : nodeItem.type) === 'item') {
|
152
153
|
var _nodeItem$value;
|
153
154
|
|
154
|
-
return contains(nodeItem === null || nodeItem === void 0 ? void 0 : (_nodeItem$value = nodeItem.value) === null || _nodeItem$value === void 0 ? void 0 : _nodeItem$value.name, searchValue)
|
155
|
+
return contains(nodeItem === null || nodeItem === void 0 ? void 0 : (_nodeItem$value = nodeItem.value) === null || _nodeItem$value === void 0 ? void 0 : _nodeItem$value.name, searchValue) && nodeItem;
|
155
156
|
}
|
156
157
|
|
157
|
-
|
158
|
-
var _context;
|
158
|
+
var childNodes = (0, _filter["default"])(_context = (0, _from["default"])(nodeItem.childNodes)).call(_context, f); // Don't return sections without children, see UIP-5951
|
159
159
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
}
|
160
|
+
return childNodes.length !== 0 && _objectSpread(_objectSpread({}, nodeItem), {}, {
|
161
|
+
childNodes: childNodes
|
162
|
+
});
|
164
163
|
}); // we are filtering null items here since we were not able to filter them in previous function
|
165
164
|
|
166
165
|
return (0, _filter["default"])(filteredSections).call(filteredSections, function (item) {
|
@@ -8,7 +8,7 @@ var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/ins
|
|
8
8
|
|
9
9
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
10
10
|
|
11
|
-
var
|
11
|
+
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
12
12
|
|
13
13
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
14
14
|
|
@@ -20,6 +20,10 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
20
20
|
|
21
21
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
22
22
|
|
23
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
24
|
+
|
25
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
26
|
+
|
23
27
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
24
28
|
|
25
29
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
@@ -44,7 +48,7 @@ var _react2 = require("@emotion/react");
|
|
44
48
|
|
45
49
|
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; }
|
46
50
|
|
47
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
51
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty2(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
48
52
|
|
49
53
|
var testEnvBreadcrumb = 'test-env-breadcrumb';
|
50
54
|
var testName = 'test-name';
|
@@ -66,6 +70,15 @@ var itemsWithSections = [{
|
|
66
70
|
}, {
|
67
71
|
name: 'Baz'
|
68
72
|
}]
|
73
|
+
}, {
|
74
|
+
name: 'Heading 2',
|
75
|
+
options: [{
|
76
|
+
name: 'Foo'
|
77
|
+
}, {
|
78
|
+
name: 'Zod'
|
79
|
+
}, {
|
80
|
+
name: 'Zay'
|
81
|
+
}]
|
69
82
|
}];
|
70
83
|
var defaultProps = {
|
71
84
|
'data-testid': testEnvBreadcrumb,
|
@@ -106,11 +119,13 @@ var getSectionsComponent = function getSectionsComponent() {
|
|
106
119
|
return (// eslint-disable-next-line testing-library/no-node-access
|
107
120
|
(0, _react2.jsx)(_collections.Section, {
|
108
121
|
key: section.name,
|
109
|
-
|
122
|
+
title: section.name,
|
110
123
|
items: section.options
|
111
124
|
}, function (item) {
|
125
|
+
var _context;
|
126
|
+
|
112
127
|
return (0, _react2.jsx)(_index.Item, {
|
113
|
-
key: item.name,
|
128
|
+
key: (0, _concat["default"])(_context = "".concat(section.name, "-")).call(_context, item.name),
|
114
129
|
childItems: item.options
|
115
130
|
}, item.name);
|
116
131
|
})
|
@@ -199,9 +214,9 @@ test('should not call onNamePress when current env button pressed', function ()
|
|
199
214
|
expect(onNamePressMock).not.toHaveBeenCalled();
|
200
215
|
});
|
201
216
|
test('should render items passed in props', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
202
|
-
return _regenerator["default"].wrap(function _callee$(
|
217
|
+
return _regenerator["default"].wrap(function _callee$(_context2) {
|
203
218
|
while (1) {
|
204
|
-
switch (
|
219
|
+
switch (_context2.prev = _context2.next) {
|
205
220
|
case 0:
|
206
221
|
getComponent();
|
207
222
|
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
@@ -214,7 +229,7 @@ test('should render items passed in props', /*#__PURE__*/(0, _asyncToGenerator2[
|
|
214
229
|
|
215
230
|
case 6:
|
216
231
|
case "end":
|
217
|
-
return
|
232
|
+
return _context2.stop();
|
218
233
|
}
|
219
234
|
}
|
220
235
|
}, _callee);
|
@@ -226,9 +241,23 @@ test('should render items with sections passed in props', function () {
|
|
226
241
|
|
227
242
|
_userEvent["default"].click(_testWrapper.screen.getByText(testSelectedItem));
|
228
243
|
|
229
|
-
|
244
|
+
var groups = _testWrapper.screen.getAllByRole('group');
|
245
|
+
|
246
|
+
expect(groups).toHaveLength(2);
|
230
247
|
expect(_testWrapper.screen.queryByRole('listbox')).toBeInTheDocument();
|
231
|
-
expect(_testWrapper.screen.queryAllByRole('option')).toHaveLength(
|
248
|
+
expect(_testWrapper.screen.queryAllByRole('option')).toHaveLength(6);
|
249
|
+
(0, _forEach["default"])(groups).call(groups, function (group, index) {
|
250
|
+
var _context3;
|
251
|
+
|
252
|
+
expect(function () {
|
253
|
+
return (0, _testWrapper.within)(group).getByText(itemsWithSections[index].name);
|
254
|
+
});
|
255
|
+
(0, _forEach["default"])(_context3 = itemsWithSections[index].options).call(_context3, function (opt) {
|
256
|
+
return expect(function () {
|
257
|
+
return (0, _testWrapper.within)(group).getByText(opt.name);
|
258
|
+
});
|
259
|
+
});
|
260
|
+
});
|
232
261
|
});
|
233
262
|
test('should call onSelectionChange when env clicked', function () {
|
234
263
|
var onSelectionChangeMock = jest.fn();
|
@@ -313,22 +342,22 @@ test('should show empty state in search if there are no results', function () {
|
|
313
342
|
test('should have no accessibility violations', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
314
343
|
var _getComponent, container, results;
|
315
344
|
|
316
|
-
return _regenerator["default"].wrap(function _callee2$(
|
345
|
+
return _regenerator["default"].wrap(function _callee2$(_context4) {
|
317
346
|
while (1) {
|
318
|
-
switch (
|
347
|
+
switch (_context4.prev = _context4.next) {
|
319
348
|
case 0:
|
320
349
|
jest.useRealTimers();
|
321
350
|
_getComponent = getComponent(), container = _getComponent.container;
|
322
|
-
|
351
|
+
_context4.next = 4;
|
323
352
|
return (0, _jestAxe.axe)(container);
|
324
353
|
|
325
354
|
case 4:
|
326
|
-
results =
|
355
|
+
results = _context4.sent;
|
327
356
|
expect(results).toHaveNoViolations();
|
328
357
|
|
329
358
|
case 6:
|
330
359
|
case "end":
|
331
|
-
return
|
360
|
+
return _context4.stop();
|
332
361
|
}
|
333
362
|
}
|
334
363
|
}, _callee2);
|
@@ -373,4 +402,16 @@ test('should add data-id to dropdown list', function () {
|
|
373
402
|
expect(_testWrapper.screen.getByRole('listbox', {
|
374
403
|
name: 'Items List'
|
375
404
|
})).toHaveAttribute('data-id', _EnvironmentBreadcrumb.breadCrumbDataIds.dropdownList);
|
405
|
+
});
|
406
|
+
test('should hide section title if no search results within it', function () {
|
407
|
+
getSectionsComponent(); // Open popover
|
408
|
+
|
409
|
+
_userEvent["default"].click(_testWrapper.screen.getByText(testSelectedItem)); // Search for option exclusive to only one section
|
410
|
+
|
411
|
+
|
412
|
+
_userEvent["default"].type(_testWrapper.screen.getByRole('searchbox'), 'Zod'); // 'Heading 1' should not be rendered, but 'Heading 2' should be
|
413
|
+
|
414
|
+
|
415
|
+
expect(_testWrapper.screen.queryByText(itemsWithSections[0].name)).not.toBeInTheDocument();
|
416
|
+
expect(_testWrapper.screen.queryByText(itemsWithSections[1].name)).toBeInTheDocument();
|
376
417
|
});
|
package/lib/cjs/index.js
CHANGED
@@ -33,6 +33,7 @@ var _exportNames = {
|
|
33
33
|
Bracket: true,
|
34
34
|
Breadcrumbs: true,
|
35
35
|
Bulletin: true,
|
36
|
+
Callout: true,
|
36
37
|
Button: true,
|
37
38
|
Card: true,
|
38
39
|
Checkbox: true,
|
@@ -197,7 +198,7 @@ _Object$defineProperty(exports, "Breadcrumbs", {
|
|
197
198
|
_Object$defineProperty(exports, "Bulletin", {
|
198
199
|
enumerable: true,
|
199
200
|
get: function get() {
|
200
|
-
return
|
201
|
+
return _Callout["default"];
|
201
202
|
}
|
202
203
|
});
|
203
204
|
|
@@ -208,6 +209,13 @@ _Object$defineProperty(exports, "Button", {
|
|
208
209
|
}
|
209
210
|
});
|
210
211
|
|
212
|
+
_Object$defineProperty(exports, "Callout", {
|
213
|
+
enumerable: true,
|
214
|
+
get: function get() {
|
215
|
+
return _Callout["default"];
|
216
|
+
}
|
217
|
+
});
|
218
|
+
|
211
219
|
_Object$defineProperty(exports, "Card", {
|
212
220
|
enumerable: true,
|
213
221
|
get: function get() {
|
@@ -927,17 +935,17 @@ _forEachInstanceProperty(_context10 = _Object$keys(_Breadcrumbs)).call(_context1
|
|
927
935
|
});
|
928
936
|
});
|
929
937
|
|
930
|
-
var
|
938
|
+
var _Callout = _interopRequireWildcard(require("./components/Callout"));
|
931
939
|
|
932
|
-
_forEachInstanceProperty(_context11 = _Object$keys(
|
940
|
+
_forEachInstanceProperty(_context11 = _Object$keys(_Callout)).call(_context11, function (key) {
|
933
941
|
if (key === "default" || key === "__esModule") return;
|
934
942
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
935
|
-
if (key in exports && exports[key] ===
|
943
|
+
if (key in exports && exports[key] === _Callout[key]) return;
|
936
944
|
|
937
945
|
_Object$defineProperty(exports, key, {
|
938
946
|
enumerable: true,
|
939
947
|
get: function get() {
|
940
|
-
return
|
948
|
+
return _Callout[key];
|
941
949
|
}
|
942
950
|
});
|
943
951
|
});
|
File without changes
|
@@ -34,26 +34,32 @@ var _accordion = _interopRequireDefault(require("./accordion"));
|
|
34
34
|
|
35
35
|
var _boxes = _interopRequireDefault(require("./boxes"));
|
36
36
|
|
37
|
+
var _callout = _interopRequireDefault(require("./callout"));
|
38
|
+
|
37
39
|
var _codeView = _interopRequireDefault(require("./codeView"));
|
38
40
|
|
39
|
-
var
|
41
|
+
var _collapsiblePanel = _interopRequireDefault(require("./collapsiblePanel"));
|
42
|
+
|
43
|
+
var _DataTable = _interopRequireDefault(require("./../../components/DataTable/DataTable.styles"));
|
40
44
|
|
41
45
|
var _imageUpload = _interopRequireDefault(require("./imageUpload"));
|
42
46
|
|
47
|
+
var _images = _interopRequireDefault(require("./images"));
|
48
|
+
|
43
49
|
var _links = _interopRequireDefault(require("./links"));
|
44
50
|
|
45
51
|
var _listBox = _interopRequireDefault(require("./listBox"));
|
46
52
|
|
47
53
|
var _loader = _interopRequireDefault(require("./loader"));
|
48
54
|
|
49
|
-
var _modal = _interopRequireDefault(require("./modal"));
|
50
|
-
|
51
55
|
var _menu = _interopRequireDefault(require("./menu"));
|
52
56
|
|
53
57
|
var _menuItem = _interopRequireDefault(require("./menuItem"));
|
54
58
|
|
55
59
|
var _messages = _interopRequireDefault(require("./messages"));
|
56
60
|
|
61
|
+
var _modal = _interopRequireDefault(require("./modal"));
|
62
|
+
|
57
63
|
var _navBar = _interopRequireDefault(require("./navBar"));
|
58
64
|
|
59
65
|
var _numberField = _interopRequireDefault(require("./numberField"));
|
@@ -74,12 +80,6 @@ var tabs = _interopRequireWildcard(require("./tabs"));
|
|
74
80
|
|
75
81
|
var _tooltip = _interopRequireDefault(require("./tooltip"));
|
76
82
|
|
77
|
-
var _collapsiblePanel = _interopRequireDefault(require("./collapsiblePanel"));
|
78
|
-
|
79
|
-
var _bulletin = _interopRequireDefault(require("./bulletin"));
|
80
|
-
|
81
|
-
var _DataTable = _interopRequireDefault(require("./../../components/DataTable/DataTable.styles"));
|
82
|
-
|
83
83
|
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); }
|
84
84
|
|
85
85
|
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; }
|
@@ -88,21 +88,22 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
88
88
|
|
89
89
|
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) { (0, _defineProperty2["default"])(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; }
|
90
90
|
|
91
|
-
var _default = _objectSpread(_objectSpread({
|
91
|
+
var _default = _objectSpread(_objectSpread({}, tabs), {}, {
|
92
92
|
accordion: _accordion["default"],
|
93
93
|
boxes: _boxes["default"],
|
94
|
-
|
94
|
+
callout: _callout["default"],
|
95
95
|
codeView: _codeView["default"],
|
96
|
-
|
96
|
+
collapsiblePanel: _collapsiblePanel["default"],
|
97
|
+
dataTable: _DataTable["default"],
|
97
98
|
imageUpload: _imageUpload["default"],
|
98
|
-
|
99
|
+
images: _images["default"],
|
99
100
|
links: _links["default"],
|
100
101
|
listBox: _listBox["default"],
|
102
|
+
loader: _loader["default"],
|
101
103
|
menu: _menu["default"],
|
102
104
|
menuItem: _menuItem["default"],
|
103
105
|
messages: _messages["default"],
|
104
106
|
modal: _modal["default"],
|
105
|
-
collapsiblePanel: _collapsiblePanel["default"],
|
106
107
|
navBar: _navBar["default"],
|
107
108
|
numberField: _numberField["default"],
|
108
109
|
overlayPanel: _overlayPanel["default"],
|
@@ -110,10 +111,8 @@ var _default = _objectSpread(_objectSpread({
|
|
110
111
|
rockerbutton: _rockerbutton["default"],
|
111
112
|
separator: _separator["default"],
|
112
113
|
stepper: _stepper["default"],
|
113
|
-
table: _table["default"]
|
114
|
-
|
115
|
-
tooltip: _tooltip["default"],
|
116
|
-
dataTable: _DataTable["default"]
|
114
|
+
table: _table["default"],
|
115
|
+
tooltip: _tooltip["default"]
|
117
116
|
});
|
118
117
|
|
119
118
|
exports["default"] = _default;
|