@pingux/astro 1.38.1 → 1.39.0-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/AccordionGridGroup/AccordionGridGroup.stories.js +10 -8
- package/lib/cjs/components/Bulletin/Bulletin.js +93 -0
- package/lib/cjs/components/Bulletin/Bulletin.stories.js +90 -0
- package/lib/cjs/components/Bulletin/Bulletin.test.js +70 -0
- package/lib/cjs/components/Bulletin/index.js +18 -0
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +1 -1
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +1 -1
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +15 -14
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +15 -1
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +36 -0
- package/lib/cjs/components/Icon/NoticeIcon.js +71 -0
- package/lib/cjs/components/Icon/NoticeIcon.test.js +35 -0
- package/lib/cjs/components/IconButton/IconButton.stories.js +11 -2
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.stories.js +3 -0
- package/lib/cjs/components/ListItem/ListItem.stories.js +4 -8
- package/lib/cjs/components/ListView/ListView.stories.js +22 -13
- package/lib/cjs/components/Messages/Message.js +27 -41
- package/lib/cjs/components/Messages/Messages.test.js +13 -0
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +2 -2
- package/lib/cjs/components/TextField/TextField.stories.js +3 -3
- package/lib/cjs/index.js +85 -62
- package/lib/cjs/recipes/ApplicationSearchDropdown.stories.js +2 -1
- package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +1 -1
- package/lib/cjs/recipes/AttributesAndPingOneMapping.stories.js +4 -2
- package/lib/cjs/recipes/CollapsiblePanel.stories.js +1 -1
- package/lib/cjs/recipes/ConditionalFilter.stories.js +1 -1
- package/lib/cjs/recipes/DatePicker.stories.js +1 -1
- package/lib/cjs/recipes/EditableInput.stories.js +4 -2
- package/lib/cjs/recipes/LinkedListView.stories.js +1 -1
- package/lib/cjs/recipes/ListAndPanel.stories.js +10 -3
- package/lib/cjs/recipes/MaskedValue.stories.js +2 -1
- package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +5 -5
- package/lib/cjs/recipes/PageHeader.stories.js +1 -1
- package/lib/cjs/recipes/PanelHeader.stories.js +2 -2
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +2 -1
- package/lib/cjs/recipes/ScrollableListView.stories.js +10 -6
- package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +2 -2
- package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +1 -1
- package/lib/cjs/styles/templates/Nav/HeaderBar.js +1 -1
- package/lib/cjs/styles/variants/bulletin.js +60 -0
- package/lib/cjs/styles/variants/buttons.js +4 -1
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +11 -9
- package/lib/components/Bulletin/Bulletin.js +70 -0
- package/lib/components/Bulletin/Bulletin.stories.js +59 -0
- package/lib/components/Bulletin/Bulletin.test.js +45 -0
- package/lib/components/Bulletin/index.js +1 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js +1 -1
- package/lib/components/ComboBoxField/ComboBoxField.js +15 -14
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +11 -0
- package/lib/components/ComboBoxField/ComboBoxField.test.js +34 -0
- package/lib/components/Icon/NoticeIcon.js +43 -0
- package/lib/components/Icon/NoticeIcon.test.js +24 -0
- package/lib/components/IconButton/IconButton.stories.js +11 -2
- package/lib/components/IconButtonToggle/IconButtonToggle.stories.js +3 -0
- package/lib/components/ListItem/ListItem.stories.js +4 -8
- package/lib/components/ListView/ListView.stories.js +22 -13
- package/lib/components/Messages/Message.js +21 -28
- package/lib/components/Messages/Messages.test.js +11 -0
- package/lib/components/NavBarSection/NavBarItemHeader.js +2 -2
- package/lib/components/TextField/TextField.stories.js +3 -3
- package/lib/index.js +2 -0
- package/lib/recipes/ApplicationSearchDropdown.stories.js +2 -1
- package/lib/recipes/AttributeMappingReadOnlyField.stories.js +1 -1
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +4 -2
- package/lib/recipes/CollapsiblePanel.stories.js +1 -1
- package/lib/recipes/ConditionalFilter.stories.js +1 -1
- package/lib/recipes/DatePicker.stories.js +1 -1
- package/lib/recipes/EditableInput.stories.js +4 -2
- package/lib/recipes/LinkedListView.stories.js +1 -1
- package/lib/recipes/ListAndPanel.stories.js +10 -3
- package/lib/recipes/MaskedValue.stories.js +2 -1
- package/lib/recipes/OneWayToBidirectionalArrow.stories.js +5 -5
- package/lib/recipes/PageHeader.stories.js +1 -1
- package/lib/recipes/PanelHeader.stories.js +2 -2
- package/lib/recipes/RadioButtonsWithLinks.stories.js +2 -1
- package/lib/recipes/ScrollableListView.stories.js +10 -6
- package/lib/recipes/TrialExperienceIndustryButtons.stories.js +2 -2
- package/lib/recipes/TrialExperienceStatusBar.stories.js +1 -1
- package/lib/styles/templates/Nav/HeaderBar.js +1 -1
- package/lib/styles/variants/bulletin.js +41 -0
- package/lib/styles/variants/buttons.js +4 -1
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +1 -1
- package/NOTICE.html +0 -4707
@@ -152,18 +152,20 @@ var Header = function Header(props) {
|
|
152
152
|
}, (0, _react2.jsx)(_index.IconButton, {
|
153
153
|
"aria-label": "create-icon",
|
154
154
|
sx: {
|
155
|
-
mr: '4px'
|
156
|
-
height: '26px',
|
157
|
-
width: '26px'
|
155
|
+
mr: '4px'
|
158
156
|
}
|
159
|
-
}, (0, _react2.jsx)(
|
157
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
158
|
+
icon: _CreateIcon["default"],
|
159
|
+
size: "sm"
|
160
|
+
})), (0, _react2.jsx)(_index.IconButton, {
|
160
161
|
"aria-label": "vertical-lines-icon",
|
161
162
|
sx: {
|
162
|
-
mr: '4px'
|
163
|
-
height: '26px',
|
164
|
-
width: '26px'
|
163
|
+
mr: '4px'
|
165
164
|
}
|
166
|
-
}, (0, _react2.jsx)(
|
165
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
166
|
+
icon: _MoreVertIcon["default"],
|
167
|
+
size: "sm"
|
168
|
+
})))));
|
167
169
|
};
|
168
170
|
|
169
171
|
var Body = function Body(props) {
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
6
|
+
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
|
11
|
+
exports["default"] = exports.BULLETIN_TEST_ID = void 0;
|
12
|
+
|
13
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
14
|
+
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
16
|
+
|
17
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
18
|
+
|
19
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
20
|
+
|
21
|
+
var _react = _interopRequireDefault(require("react"));
|
22
|
+
|
23
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
24
|
+
|
25
|
+
var _ = require("../..");
|
26
|
+
|
27
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
28
|
+
|
29
|
+
var _NoticeIcon = require("../Icon/NoticeIcon");
|
30
|
+
|
31
|
+
var _react2 = require("@emotion/react");
|
32
|
+
|
33
|
+
var _excluded = ["children", "status"];
|
34
|
+
|
35
|
+
var _bulletinProps;
|
36
|
+
|
37
|
+
var BULLETIN_TEST_ID = 'bulletinTestId';
|
38
|
+
exports.BULLETIN_TEST_ID = BULLETIN_TEST_ID;
|
39
|
+
var bulletinProps = (_bulletinProps = {}, (0, _defineProperty2["default"])(_bulletinProps, _statuses["default"].DEFAULT, {
|
40
|
+
color: 'text.secondary',
|
41
|
+
variant: 'bulletin.base'
|
42
|
+
}), (0, _defineProperty2["default"])(_bulletinProps, _statuses["default"].ERROR, {
|
43
|
+
color: 'critical.bright',
|
44
|
+
variant: 'bulletin.error'
|
45
|
+
}), (0, _defineProperty2["default"])(_bulletinProps, _statuses["default"].SUCCESS, {
|
46
|
+
color: 'success.bright',
|
47
|
+
variant: 'bulletin.success'
|
48
|
+
}), (0, _defineProperty2["default"])(_bulletinProps, _statuses["default"].WARNING, {
|
49
|
+
color: 'warning.bright',
|
50
|
+
variant: 'bulletin.warning'
|
51
|
+
}), _bulletinProps);
|
52
|
+
var defaultIconProps = {
|
53
|
+
mr: 'md',
|
54
|
+
ml: 'md',
|
55
|
+
size: 'md'
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
*Bulletin 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 Bulletins
|
60
|
+
status is error or warning, the text should include a direct link to instructions on resolving the
|
61
|
+
issue or error.
|
62
|
+
*
|
63
|
+
*Please note, Bulletin is a static component, the [Messages](./?path=/docs/messages) component is
|
64
|
+
recommended if you need to interrupt and notify users of successful/failed actions or
|
65
|
+
give warnings of unexpected events.
|
66
|
+
*/
|
67
|
+
|
68
|
+
var Bulletin = function Bulletin(_ref) {
|
69
|
+
var children = _ref.children,
|
70
|
+
status = _ref.status,
|
71
|
+
others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
72
|
+
return (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
|
73
|
+
"data-testid": BULLETIN_TEST_ID,
|
74
|
+
isRow: true,
|
75
|
+
role: "note",
|
76
|
+
variant: bulletinProps[status].variant
|
77
|
+
}, others), (0, _react2.jsx)(_NoticeIcon.NoticeIcon, (0, _extends2["default"])({
|
78
|
+
color: bulletinProps[status].color,
|
79
|
+
status: status,
|
80
|
+
"aria-label": "".concat(status, "-icon")
|
81
|
+
}, defaultIconProps)), children);
|
82
|
+
};
|
83
|
+
|
84
|
+
Bulletin.propTypes = {
|
85
|
+
/** Determines the icon and color */
|
86
|
+
status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"]))
|
87
|
+
};
|
88
|
+
Bulletin.defaultProps = {
|
89
|
+
status: _statuses["default"].DEFAULT
|
90
|
+
};
|
91
|
+
Bulletin.displayName = 'Bulletin';
|
92
|
+
var _default = Bulletin;
|
93
|
+
exports["default"] = _default;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
6
|
+
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
|
11
|
+
exports["default"] = exports.Warning = exports.Success = exports.ErrorStatus = exports.Default = void 0;
|
12
|
+
|
13
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
14
|
+
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
16
|
+
|
17
|
+
var _ = require("../..");
|
18
|
+
|
19
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
20
|
+
|
21
|
+
var _Bulletin = _interopRequireDefault(require("./Bulletin"));
|
22
|
+
|
23
|
+
var _react2 = require("@emotion/react");
|
24
|
+
|
25
|
+
var _default = {
|
26
|
+
title: 'Bulletin',
|
27
|
+
component: _Bulletin["default"],
|
28
|
+
argTypes: {
|
29
|
+
status: {
|
30
|
+
control: {
|
31
|
+
type: 'select',
|
32
|
+
options: (0, _values["default"])(_statuses["default"])
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}; // main
|
37
|
+
|
38
|
+
exports["default"] = _default;
|
39
|
+
|
40
|
+
var Default = function Default(args) {
|
41
|
+
return (0, _react2.jsx)(_Bulletin["default"], 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
|
+
href: "https://pingidentity.com",
|
43
|
+
target: "_blank",
|
44
|
+
"aria-label": "".concat(_statuses["default"].DEFAULT, "-bulletin"),
|
45
|
+
variant: "app"
|
46
|
+
}, " Read More")));
|
47
|
+
};
|
48
|
+
|
49
|
+
exports.Default = Default;
|
50
|
+
|
51
|
+
var ErrorStatus = function ErrorStatus() {
|
52
|
+
return (0, _react2.jsx)(_Bulletin["default"], {
|
53
|
+
status: _statuses["default"].ERROR
|
54
|
+
}, (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
|
+
href: "https://pingidentity.com",
|
56
|
+
target: "_blank",
|
57
|
+
"aria-label": "".concat(_statuses["default"].ERROR, "-bulletin"),
|
58
|
+
variant: "app"
|
59
|
+
}, " Read More")));
|
60
|
+
}; // Avoiding using Error as the function name due to it being a JS built-in method
|
61
|
+
|
62
|
+
|
63
|
+
exports.ErrorStatus = ErrorStatus;
|
64
|
+
ErrorStatus.storyName = 'Error';
|
65
|
+
|
66
|
+
var Success = function Success() {
|
67
|
+
return (0, _react2.jsx)(_Bulletin["default"], {
|
68
|
+
status: _statuses["default"].SUCCESS
|
69
|
+
}, (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
|
+
href: "https://pingidentity.com",
|
71
|
+
target: "_blank",
|
72
|
+
"aria-label": "".concat(_statuses["default"].SUCCESS, "-bulletin"),
|
73
|
+
variant: "app"
|
74
|
+
}, " Read More")));
|
75
|
+
};
|
76
|
+
|
77
|
+
exports.Success = Success;
|
78
|
+
|
79
|
+
var Warning = function Warning() {
|
80
|
+
return (0, _react2.jsx)(_Bulletin["default"], {
|
81
|
+
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 Bulletin box will grow in height with the content", (0, _react2.jsx)(_.Link, {
|
83
|
+
href: "https://pingidentity.com",
|
84
|
+
target: "_blank",
|
85
|
+
"aria-label": "".concat(_statuses["default"].WARNING, "-bulletin"),
|
86
|
+
variant: "app"
|
87
|
+
}, " Read More")));
|
88
|
+
};
|
89
|
+
|
90
|
+
exports.Warning = Warning;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
+
|
5
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
6
|
+
|
7
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
8
|
+
|
9
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
10
|
+
|
11
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
12
|
+
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
14
|
+
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
16
|
+
|
17
|
+
var _react2 = require("@testing-library/react");
|
18
|
+
|
19
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
20
|
+
|
21
|
+
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
22
|
+
|
23
|
+
var _NoticeIcon = require("../Icon/NoticeIcon");
|
24
|
+
|
25
|
+
var _Bulletin = _interopRequireWildcard(require("./Bulletin"));
|
26
|
+
|
27
|
+
var _react3 = require("@emotion/react");
|
28
|
+
|
29
|
+
var _testColors;
|
30
|
+
|
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); }
|
32
|
+
|
33
|
+
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; }
|
34
|
+
|
35
|
+
var TEST_TEXT = 'test text';
|
36
|
+
var testColors = (_testColors = {}, (0, _defineProperty2["default"])(_testColors, _statuses["default"].DEFAULT, 'var(--theme-ui-colors-text-secondary)'), (0, _defineProperty2["default"])(_testColors, _statuses["default"].ERROR, 'var(--theme-ui-colors-critical-bright)'), (0, _defineProperty2["default"])(_testColors, _statuses["default"].SUCCESS, 'var(--theme-ui-colors-success-bright)'), (0, _defineProperty2["default"])(_testColors, _statuses["default"].WARNING, 'var(--theme-ui-colors-warning-bright)'), _testColors);
|
37
|
+
|
38
|
+
var getComponent = function getComponent() {
|
39
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
40
|
+
return (0, _testWrapper.render)((0, _react3.jsx)(_Bulletin["default"], props, TEST_TEXT));
|
41
|
+
};
|
42
|
+
|
43
|
+
describe('Bulletin', function () {
|
44
|
+
test('renders', function () {
|
45
|
+
getComponent();
|
46
|
+
|
47
|
+
_react2.screen.getByText(TEST_TEXT);
|
48
|
+
});
|
49
|
+
test('renders the default color', function () {
|
50
|
+
getComponent();
|
51
|
+
expect(_react2.screen.getByTestId(_Bulletin.BULLETIN_TEST_ID)).toHaveStyle({
|
52
|
+
'border-color': testColors[_statuses["default"].DEFAULT]
|
53
|
+
});
|
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 Bulletin with color %s', function (status, expected) {
|
56
|
+
getComponent({
|
57
|
+
status: status
|
58
|
+
});
|
59
|
+
expect(_react2.screen.getByTestId(_Bulletin.BULLETIN_TEST_ID)).toHaveStyle({
|
60
|
+
'border-color': expected
|
61
|
+
});
|
62
|
+
});
|
63
|
+
test.each([[_statuses["default"].DEFAULT, _NoticeIcon.noticeIcons[_statuses["default"].DEFAULT].testid], [_statuses["default"].ERROR, _NoticeIcon.noticeIcons[_statuses["default"].ERROR].testid], [_statuses["default"].SUCCESS, _NoticeIcon.noticeIcons[_statuses["default"].SUCCESS].testid], [_statuses["default"].WARNING, _NoticeIcon.noticeIcons[_statuses["default"].WARNING].testid]])('when given status %s it renders %s', function (status, icon) {
|
64
|
+
getComponent({
|
65
|
+
status: status
|
66
|
+
});
|
67
|
+
|
68
|
+
_react2.screen.getByTestId(icon);
|
69
|
+
});
|
70
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
6
|
+
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
|
11
|
+
_Object$defineProperty(exports, "default", {
|
12
|
+
enumerable: true,
|
13
|
+
get: function get() {
|
14
|
+
return _Bulletin["default"];
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
18
|
+
var _Bulletin = _interopRequireDefault(require("./Bulletin"));
|
@@ -256,7 +256,7 @@ var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args) {
|
|
256
256
|
}
|
257
257
|
}, (0, _react2.jsx)(_index.Icon, {
|
258
258
|
icon: _CloseIcon["default"],
|
259
|
-
size:
|
259
|
+
size: "sm"
|
260
260
|
}))))), (0, _react2.jsx)(_index.Box, {
|
261
261
|
pl: "md",
|
262
262
|
pt: "25px"
|
@@ -147,7 +147,7 @@ var ComboBoxInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
147
147
|
}, [isLoading, showLoading, inputValue]); // END - minimum delay time for loading indicator = 500ms
|
148
148
|
|
149
149
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
150
|
-
var button = (0, _react2.jsx)(_.Box, {
|
150
|
+
var button = !isReadOnly && (0, _react2.jsx)(_.Box, {
|
151
151
|
isRow: true,
|
152
152
|
variant: "boxes.inputInContainerSlot"
|
153
153
|
}, // Render loader after delay if filtering or loading
|
@@ -76,7 +76,7 @@ var _ScrollBox = _interopRequireDefault(require("../ScrollBox"));
|
|
76
76
|
|
77
77
|
var _react2 = require("@emotion/react");
|
78
78
|
|
79
|
-
var _excluded = ["hasAutoFocus", "hasAddOption", "hasCustomValue", "hasNoEmptySelection", "selectedKey", "onSelectionChange", "defaultItems", "items", "loadingState", "onLoadMore", "inputValue", "menuTrigger", "isNotFlippable", "direction", "scrollBoxProps", "controlProps", "defaultFilter", "status", "helperText"],
|
79
|
+
var _excluded = ["hasAutoFocus", "hasAddOption", "hasCustomValue", "hasNoEmptySelection", "selectedKey", "onSelectionChange", "defaultItems", "items", "loadingState", "onLoadMore", "inputValue", "isReadOnly", "menuTrigger", "isNotFlippable", "direction", "scrollBoxProps", "controlProps", "defaultFilter", "status", "helperText"],
|
80
80
|
_excluded2 = ["shouldFocusOnHover", "shouldSelectOnPressUp"];
|
81
81
|
|
82
82
|
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); }
|
@@ -108,6 +108,7 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
108
108
|
loadingState = props.loadingState,
|
109
109
|
onLoadMore = props.onLoadMore,
|
110
110
|
inputValue = props.inputValue,
|
111
|
+
isReadOnly = props.isReadOnly,
|
111
112
|
menuTrigger = props.menuTrigger,
|
112
113
|
isNotFlippable = props.isNotFlippable,
|
113
114
|
direction = props.direction,
|
@@ -183,7 +184,7 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
183
184
|
contains = _useFilter.contains;
|
184
185
|
|
185
186
|
var state = (0, _combobox2.useComboBoxState)(_objectSpread(_objectSpread({}, comboBoxOptions), {}, {
|
186
|
-
defaultItems: defaultItems,
|
187
|
+
defaultItems: isReadOnly ? [] : defaultItems,
|
187
188
|
items: items,
|
188
189
|
onSelectionChange: hasAddOption || hasCustomValue ? onSelectionChangeHandler : onSelectionChange,
|
189
190
|
defaultFilter: typeof defaultFilter !== 'undefined' ? defaultFilter : contains
|
@@ -254,7 +255,16 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
254
255
|
minWidth: menuWidth
|
255
256
|
});
|
256
257
|
|
257
|
-
var
|
258
|
+
var listBox = !isReadOnly && (0, _react2.jsx)(_PopoverContainer["default"], {
|
259
|
+
hasNoArrow: true,
|
260
|
+
isDismissable: true,
|
261
|
+
isNonModal: true,
|
262
|
+
isOpen: state.isOpen,
|
263
|
+
onClose: state.close,
|
264
|
+
placement: placement,
|
265
|
+
ref: popoverRef,
|
266
|
+
style: style
|
267
|
+
}, (0, _react2.jsx)(_focus.FocusScope, {
|
258
268
|
restoreFocus: true
|
259
269
|
}, (0, _react2.jsx)(_overlays.DismissButton, {
|
260
270
|
onDismiss: state.close
|
@@ -270,7 +280,7 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
270
280
|
isSelectedOnPressUp: shouldSelectOnPressUp
|
271
281
|
}, otherListBoxProps))), (0, _react2.jsx)(_overlays.DismissButton, {
|
272
282
|
onDismiss: state.close
|
273
|
-
}));
|
283
|
+
})));
|
274
284
|
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_ComboBox["default"], (0, _extends2["default"])({}, props, {
|
275
285
|
isOpen: state.isOpen,
|
276
286
|
inputProps: inputProps,
|
@@ -281,16 +291,7 @@ var ComboBoxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
281
291
|
triggerRef: buttonRef,
|
282
292
|
controlProps: controlProps,
|
283
293
|
"aria-invalid": status === 'error' && true
|
284
|
-
})),
|
285
|
-
hasNoArrow: true,
|
286
|
-
isDismissable: true,
|
287
|
-
isNonModal: true,
|
288
|
-
isOpen: state.isOpen,
|
289
|
-
onClose: state.close,
|
290
|
-
placement: placement,
|
291
|
-
ref: popoverRef,
|
292
|
-
style: style
|
293
|
-
}, listbox));
|
294
|
+
})), listBox);
|
294
295
|
});
|
295
296
|
ComboBoxField.propTypes = _objectSpread({
|
296
297
|
/* Whether or not adding new options to the list is enabled. */
|
@@ -26,7 +26,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
26
26
|
value: true
|
27
27
|
});
|
28
28
|
|
29
|
-
exports["default"] = exports.WithoutStatusIndicator = exports.WithSections = exports.WithCustomInputValue = exports.WithCustomHeight = exports.Required = exports.HelperText = exports.FocusMenuTrigger = exports.DisabledKeys = exports.Disabled = exports.Default = exports.CustomDefaultFilter = exports.ControlledWithCustomValue = exports.ControlledWithAddOption = exports.ControlledSelection = exports.ControlledMenu = exports.ControlledInput = exports.ControlledFiltering = exports.AsyncLoading = exports.AllowCustomValue = void 0;
|
29
|
+
exports["default"] = exports.WithoutStatusIndicator = exports.WithSections = exports.WithCustomInputValue = exports.WithCustomHeight = exports.Required = exports.ReadOnly = exports.HelperText = exports.FocusMenuTrigger = exports.DisabledKeys = exports.Disabled = exports.Default = exports.CustomDefaultFilter = exports.ControlledWithCustomValue = exports.ControlledWithAddOption = exports.ControlledSelection = exports.ControlledMenu = exports.ControlledInput = exports.ControlledFiltering = exports.AsyncLoading = exports.AllowCustomValue = void 0;
|
30
30
|
|
31
31
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
32
32
|
|
@@ -567,6 +567,20 @@ var HelperText = function HelperText() {
|
|
567
567
|
|
568
568
|
exports.HelperText = HelperText;
|
569
569
|
|
570
|
+
var ReadOnly = function ReadOnly() {
|
571
|
+
return (0, _react2.jsx)(_.OverlayProvider, null, (0, _react2.jsx)(_ComboBoxField["default"], (0, _extends2["default"])({
|
572
|
+
label: "Example label",
|
573
|
+
defaultItems: items,
|
574
|
+
isReadOnly: true
|
575
|
+
}, actions), function (item) {
|
576
|
+
return (0, _react2.jsx)(_.Item, {
|
577
|
+
key: item.name
|
578
|
+
}, item.name);
|
579
|
+
}));
|
580
|
+
};
|
581
|
+
|
582
|
+
exports.ReadOnly = ReadOnly;
|
583
|
+
|
570
584
|
var Required = function Required() {
|
571
585
|
return (0, _react2.jsx)(_.OverlayProvider, null, (0, _react2.jsx)(_ComboBoxField["default"], (0, _extends2["default"])({
|
572
586
|
label: "Example label",
|
@@ -1215,4 +1215,40 @@ test('popover closes on input blur', function () {
|
|
1215
1215
|
|
1216
1216
|
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
1217
1217
|
expect(_testWrapper.screen.queryByRole('option')).not.toBeInTheDocument();
|
1218
|
+
});
|
1219
|
+
describe('when isReadOnly is true', function () {
|
1220
|
+
var testProp = {
|
1221
|
+
isReadOnly: true
|
1222
|
+
};
|
1223
|
+
var TEST_DEFAULT_INPUT_VALUE = 'test default input value';
|
1224
|
+
test('it does not have the show suggestions button', function () {
|
1225
|
+
getComponent(testProp);
|
1226
|
+
expect(_testWrapper.screen.queryByRole('button', {
|
1227
|
+
name: "".concat(defaultProps.label, " Show suggestions")
|
1228
|
+
})).not.toBeInTheDocument();
|
1229
|
+
});
|
1230
|
+
test('it has attribute readonly', function () {
|
1231
|
+
getComponent(testProp);
|
1232
|
+
expect(_testWrapper.screen.getByRole('combobox', {
|
1233
|
+
name: defaultProps.label
|
1234
|
+
})).toHaveAttribute('readonly');
|
1235
|
+
});
|
1236
|
+
test('the default selected value is selected', function () {
|
1237
|
+
testProp.defaultInputValue = TEST_DEFAULT_INPUT_VALUE;
|
1238
|
+
getComponent(testProp);
|
1239
|
+
expect(_testWrapper.screen.getByRole('combobox', {
|
1240
|
+
name: defaultProps.label
|
1241
|
+
})).toHaveValue(TEST_DEFAULT_INPUT_VALUE);
|
1242
|
+
});
|
1243
|
+
test('the dropdown does not open when clicked', function () {
|
1244
|
+
getComponent(testProp);
|
1245
|
+
|
1246
|
+
_userEvent["default"].click(_testWrapper.screen.getByRole('combobox', {
|
1247
|
+
name: defaultProps.label
|
1248
|
+
}));
|
1249
|
+
|
1250
|
+
expect(_testWrapper.screen.queryByRole('listbox', {
|
1251
|
+
name: 'Test Label Suggestions'
|
1252
|
+
})).not.toBeInTheDocument();
|
1253
|
+
});
|
1218
1254
|
});
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
6
|
+
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
|
11
|
+
exports.noticeIcons = exports.NoticeIcon = void 0;
|
12
|
+
|
13
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
14
|
+
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
16
|
+
|
17
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
18
|
+
|
19
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
20
|
+
|
21
|
+
var _react = _interopRequireDefault(require("react"));
|
22
|
+
|
23
|
+
var _AlertCircleIcon = _interopRequireDefault(require("mdi-react/AlertCircleIcon"));
|
24
|
+
|
25
|
+
var _AlertIcon = _interopRequireDefault(require("mdi-react/AlertIcon"));
|
26
|
+
|
27
|
+
var _CheckCircleIcon = _interopRequireDefault(require("mdi-react/CheckCircleIcon"));
|
28
|
+
|
29
|
+
var _InformationIcon = _interopRequireDefault(require("mdi-react/InformationIcon"));
|
30
|
+
|
31
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
32
|
+
|
33
|
+
var _ = require("../..");
|
34
|
+
|
35
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
36
|
+
|
37
|
+
var _react2 = require("@emotion/react");
|
38
|
+
|
39
|
+
var _excluded = ["status"];
|
40
|
+
|
41
|
+
var _noticeIcons;
|
42
|
+
|
43
|
+
var noticeIcons = (_noticeIcons = {}, (0, _defineProperty2["default"])(_noticeIcons, _statuses["default"].DEFAULT, {
|
44
|
+
icon: _InformationIcon["default"],
|
45
|
+
testid: 'default-icon-testid'
|
46
|
+
}), (0, _defineProperty2["default"])(_noticeIcons, _statuses["default"].ERROR, {
|
47
|
+
icon: _AlertCircleIcon["default"],
|
48
|
+
testid: 'error-icon-testid'
|
49
|
+
}), (0, _defineProperty2["default"])(_noticeIcons, _statuses["default"].SUCCESS, {
|
50
|
+
icon: _CheckCircleIcon["default"],
|
51
|
+
testid: 'success-icon-testid'
|
52
|
+
}), (0, _defineProperty2["default"])(_noticeIcons, _statuses["default"].WARNING, {
|
53
|
+
icon: _AlertIcon["default"],
|
54
|
+
testid: 'warning-icon-testid'
|
55
|
+
}), _noticeIcons);
|
56
|
+
exports.noticeIcons = noticeIcons;
|
57
|
+
|
58
|
+
var NoticeIcon = function NoticeIcon(_ref) {
|
59
|
+
var _ref$status = _ref.status,
|
60
|
+
status = _ref$status === void 0 ? _statuses["default"].DEFAULT : _ref$status,
|
61
|
+
others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
62
|
+
return (0, _react2.jsx)(_.Icon, (0, _extends2["default"])({
|
63
|
+
"data-testid": noticeIcons[status].testid,
|
64
|
+
icon: noticeIcons[status].icon
|
65
|
+
}, others));
|
66
|
+
};
|
67
|
+
|
68
|
+
exports.NoticeIcon = NoticeIcon;
|
69
|
+
NoticeIcon.propTypes = {
|
70
|
+
status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"]))
|
71
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
6
|
+
|
7
|
+
var _react2 = require("@testing-library/react");
|
8
|
+
|
9
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
10
|
+
|
11
|
+
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
12
|
+
|
13
|
+
var _NoticeIcon = require("./NoticeIcon");
|
14
|
+
|
15
|
+
var _react3 = require("@emotion/react");
|
16
|
+
|
17
|
+
var getComponent = function getComponent() {
|
18
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
19
|
+
return (0, _testWrapper.render)((0, _react3.jsx)(_NoticeIcon.NoticeIcon, props));
|
20
|
+
};
|
21
|
+
|
22
|
+
describe('NoticeIcon', function () {
|
23
|
+
test('renders', function () {
|
24
|
+
getComponent();
|
25
|
+
|
26
|
+
_react2.screen.getByTestId(_NoticeIcon.noticeIcons[_statuses["default"].DEFAULT].testid);
|
27
|
+
});
|
28
|
+
test.each([[_statuses["default"].DEFAULT, _NoticeIcon.noticeIcons[_statuses["default"].DEFAULT].testid], [_statuses["default"].ERROR, _NoticeIcon.noticeIcons[_statuses["default"].ERROR].testid], [_statuses["default"].SUCCESS, _NoticeIcon.noticeIcons[_statuses["default"].SUCCESS].testid], [_statuses["default"].WARNING, _NoticeIcon.noticeIcons[_statuses["default"].WARNING].testid]])('when given status %s it renders icon with %s', function (status, icon) {
|
29
|
+
getComponent({
|
30
|
+
status: status
|
31
|
+
});
|
32
|
+
|
33
|
+
_react2.screen.getByTestId(icon);
|
34
|
+
});
|
35
|
+
});
|
@@ -63,6 +63,13 @@ var _default = {
|
|
63
63
|
options: ['iconButton', 'inverted', 'square', 'invertedSquare']
|
64
64
|
},
|
65
65
|
defaultValue: 'iconButton'
|
66
|
+
},
|
67
|
+
size: {
|
68
|
+
control: {
|
69
|
+
type: 'select',
|
70
|
+
options: ['xs', 'sm', 'md']
|
71
|
+
},
|
72
|
+
defaultValue: 'sm'
|
66
73
|
}
|
67
74
|
}
|
68
75
|
};
|
@@ -72,7 +79,8 @@ var Default = function Default(args) {
|
|
72
79
|
return (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({
|
73
80
|
"aria-label": "default icon button"
|
74
81
|
}, args), (0, _react2.jsx)(_index.Icon, {
|
75
|
-
icon: _CreateIcon["default"]
|
82
|
+
icon: _CreateIcon["default"],
|
83
|
+
size: args.size
|
76
84
|
}));
|
77
85
|
};
|
78
86
|
|
@@ -83,7 +91,8 @@ var WithTooltip = function WithTooltip() {
|
|
83
91
|
"aria-label": "icon button with tooltip",
|
84
92
|
title: "Edit"
|
85
93
|
}, (0, _react2.jsx)(_index.Icon, {
|
86
|
-
icon: _CreateIcon["default"]
|
94
|
+
icon: _CreateIcon["default"],
|
95
|
+
size: "sm"
|
87
96
|
}));
|
88
97
|
};
|
89
98
|
|
@@ -55,11 +55,9 @@ var Default = function Default(args) {
|
|
55
55
|
}, "Fons Vernall")), (0, _react2.jsx)(_Box["default"], {
|
56
56
|
isRow: true,
|
57
57
|
alignSelf: "center"
|
58
|
-
}, (0, _react2.jsx)(_IconButton["default"], {
|
59
|
-
size: 26
|
60
|
-
}, (0, _react2.jsx)(_Icon["default"], {
|
58
|
+
}, (0, _react2.jsx)(_IconButton["default"], null, (0, _react2.jsx)(_Icon["default"], {
|
61
59
|
icon: _MoreVertIcon["default"],
|
62
|
-
size:
|
60
|
+
size: "sm",
|
63
61
|
color: "neutral.20"
|
64
62
|
})))), (0, _react2.jsx)(_Separator["default"], {
|
65
63
|
margin: 0
|
@@ -89,11 +87,9 @@ var WithSubtitle = function WithSubtitle(args) {
|
|
89
87
|
}, "fvernall0@google.it"))), (0, _react2.jsx)(_Box["default"], {
|
90
88
|
isRow: true,
|
91
89
|
alignSelf: "center"
|
92
|
-
}, (0, _react2.jsx)(_IconButton["default"], {
|
93
|
-
size: 26
|
94
|
-
}, (0, _react2.jsx)(_Icon["default"], {
|
90
|
+
}, (0, _react2.jsx)(_IconButton["default"], null, (0, _react2.jsx)(_Icon["default"], {
|
95
91
|
icon: _MoreVertIcon["default"],
|
96
|
-
size:
|
92
|
+
size: "sm",
|
97
93
|
color: "neutral.20"
|
98
94
|
})))), (0, _react2.jsx)(_Separator["default"], {
|
99
95
|
margin: 0
|