@pingux/astro 2.54.0-alpha.4 → 2.55.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/ArrayField/ArrayField.js +2 -1
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +2 -3
- package/lib/cjs/components/Button/Button.js +4 -2
- package/lib/cjs/components/CheckboxField/CheckboxField.js +4 -2
- package/lib/cjs/components/ColorField/ColorField.js +4 -2
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +4 -2
- package/lib/cjs/components/DatePicker/DatePicker.js +4 -2
- package/lib/cjs/components/FileInputField/FileInputField.js +4 -2
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +7 -7
- package/lib/cjs/components/IconButton/IconButton.js +4 -2
- package/lib/cjs/components/IconButton/IconButton.styles.d.ts +72 -1
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +4 -2
- package/lib/cjs/components/Input/Input.js +7 -6
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +4 -2
- package/lib/cjs/components/ListViewItem/ListViewItem.js +4 -2
- package/lib/cjs/components/Messages/Message.d.ts +9 -0
- package/lib/cjs/components/Messages/Message.js +16 -46
- package/lib/cjs/components/Messages/Message.styles.d.ts +151 -0
- package/lib/cjs/components/Messages/Messages.d.ts +4 -0
- package/lib/cjs/components/Messages/Messages.js +2 -15
- package/lib/cjs/components/Messages/Messages.stories.d.ts +128 -0
- package/lib/cjs/components/Messages/Messages.stories.js +96 -16
- package/lib/cjs/components/Messages/Messages.test.d.ts +1 -0
- package/lib/cjs/components/Messages/Messages.test.js +9 -9
- package/lib/cjs/components/Messages/index.d.ts +3 -0
- package/lib/cjs/components/Messages/index.js +2 -3
- package/lib/cjs/components/Messages/utils/index.d.ts +2 -0
- package/lib/cjs/components/Messages/utils/messagesReducer.d.ts +107 -0
- package/lib/cjs/components/Messages/utils/messagesReducer.js +29 -15
- package/lib/cjs/components/Messages/utils/multiMessagesReducer.d.ts +83 -0
- package/lib/cjs/components/Messages/utils/multiMessagesReducer.js +20 -14
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.d.ts +1 -0
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.js +4 -3
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.d.ts +1 -0
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.js +3 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +2 -3
- package/lib/cjs/components/NumberField/NumberField.js +2 -1
- package/lib/cjs/components/PasswordField/PasswordField.js +4 -2
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +4 -2
- package/lib/cjs/components/SearchField/SearchField.js +4 -2
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +2 -1
- package/lib/cjs/components/SwitchField/SwitchField.js +5 -3
- package/lib/cjs/components/Tab/Tab.js +2 -1
- package/lib/cjs/components/TextAreaField/TextAreaField.js +4 -2
- package/lib/cjs/components/TextField/TextField.js +4 -2
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.js +2 -1
- package/lib/cjs/recipes/ListAndPanel.stories.js +315 -115
- package/lib/cjs/recipes/PanelContent.stories.js +26 -168
- package/lib/cjs/recipes/items.js +152 -2
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +25 -14
- package/lib/cjs/types/item.d.ts +2 -0
- package/lib/cjs/types/messages.d.ts +43 -0
- package/lib/cjs/types/messages.js +6 -0
- package/lib/cjs/utils/devUtils/constants/pendoID.d.ts +3 -0
- package/lib/cjs/utils/devUtils/constants/pendoID.js +13 -0
- package/lib/components/ArrayField/ArrayField.js +2 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +2 -3
- package/lib/components/Button/Button.js +4 -2
- package/lib/components/CheckboxField/CheckboxField.js +4 -2
- package/lib/components/ColorField/ColorField.js +4 -2
- package/lib/components/ComboBoxField/ComboBoxField.js +4 -2
- package/lib/components/DatePicker/DatePicker.js +4 -2
- package/lib/components/FileInputField/FileInputField.js +4 -2
- package/lib/components/HelpHint/HelpHint.stories.js +7 -7
- package/lib/components/IconButton/IconButton.js +4 -2
- package/lib/components/ImageUploadField/ImageUploadField.js +4 -2
- package/lib/components/Input/Input.js +6 -5
- package/lib/components/LinkSelectField/LinkSelectField.js +4 -2
- package/lib/components/ListViewItem/ListViewItem.js +4 -2
- package/lib/components/Messages/Message.js +14 -46
- package/lib/components/Messages/Messages.js +2 -15
- package/lib/components/Messages/Messages.stories.js +95 -15
- package/lib/components/Messages/Messages.test.js +9 -9
- package/lib/components/Messages/index.js +1 -1
- package/lib/components/Messages/utils/messagesReducer.js +27 -13
- package/lib/components/Messages/utils/multiMessagesReducer.js +20 -10
- package/lib/components/Messages/utils/tests/messagesReducer.test.js +4 -3
- package/lib/components/Messages/utils/tests/multiMessagesReducer.test.js +9 -8
- package/lib/components/MultivaluesField/MultivaluesField.js +3 -4
- package/lib/components/NumberField/NumberField.js +2 -1
- package/lib/components/PasswordField/PasswordField.js +4 -2
- package/lib/components/RadioGroupField/RadioGroupField.js +4 -2
- package/lib/components/SearchField/SearchField.js +4 -2
- package/lib/components/SelectFieldBase/SelectFieldBase.js +2 -1
- package/lib/components/SwitchField/SwitchField.js +5 -3
- package/lib/components/Tab/Tab.js +2 -1
- package/lib/components/TextAreaField/TextAreaField.js +4 -2
- package/lib/components/TextField/TextField.js +4 -2
- package/lib/components/TimeZonePicker/TimeZonePicker.js +2 -1
- package/lib/recipes/ListAndPanel.stories.js +315 -115
- package/lib/recipes/PanelContent.stories.js +16 -158
- package/lib/recipes/items.js +148 -1
- package/lib/types/index.js +1 -0
- package/lib/types/messages.js +1 -0
- package/lib/utils/devUtils/constants/pendoID.js +5 -0
- package/package.json +1 -1
- package/lib/cjs/components/Messages/Messages.reducer.js +0 -51
- package/lib/components/Messages/Messages.reducer.js +0 -41
@@ -1,15 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
-
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
5
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
6
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
7
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
8
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
9
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
10
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
11
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
12
4
|
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
13
7
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
14
8
|
_Object$defineProperty(exports, "__esModule", {
|
15
9
|
value: true
|
@@ -21,17 +15,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
21
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
22
16
|
var _react = _interopRequireWildcard(require("react"));
|
23
17
|
var _CloseIcon = _interopRequireDefault(require("@pingux/mdi-react/CloseIcon"));
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
25
18
|
var _ = require("../..");
|
26
19
|
var _useStatusClasses4 = _interopRequireDefault(require("../../hooks/useStatusClasses"));
|
27
|
-
var
|
20
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
28
21
|
var _NoticeIcon = require("../Icon/NoticeIcon");
|
29
22
|
var _react2 = require("@emotion/react");
|
30
23
|
var _excluded = ["color"];
|
31
24
|
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
25
|
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; }
|
33
|
-
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; }
|
34
|
-
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; }
|
35
26
|
var ARIA_STATUSES = {
|
36
27
|
SUCCESS: 'Success Message',
|
37
28
|
ERROR: 'Error Message',
|
@@ -56,28 +47,26 @@ var CloseButton = function CloseButton(_ref) {
|
|
56
47
|
}
|
57
48
|
}));
|
58
49
|
};
|
59
|
-
CloseButton.propTypes = {
|
60
|
-
color: _propTypes["default"].string
|
61
|
-
};
|
62
50
|
var Message = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
63
51
|
var className = _ref2.className,
|
64
52
|
item = _ref2.item,
|
65
53
|
onClose = _ref2.onClose;
|
66
54
|
var key = item.key,
|
67
55
|
itemProps = item.props;
|
68
|
-
var
|
69
|
-
|
70
|
-
status =
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
isHidden =
|
76
|
-
|
56
|
+
var _ref3 = itemProps,
|
57
|
+
children = _ref3.children,
|
58
|
+
_ref3$status = _ref3.status,
|
59
|
+
status = _ref3$status === void 0 ? _statuses["default"].DEFAULT : _ref3$status,
|
60
|
+
bg = _ref3.bg,
|
61
|
+
color = _ref3.color,
|
62
|
+
icon = _ref3.icon,
|
63
|
+
_ref3$isHidden = _ref3.isHidden,
|
64
|
+
isHidden = _ref3$isHidden === void 0 ? false : _ref3$isHidden,
|
65
|
+
dataId = _ref3['data-id'];
|
77
66
|
var _useStatusClasses = (0, _useStatusClasses4["default"])(className, (0, _defineProperty2["default"])({}, "is-".concat(status), true)),
|
78
67
|
statusClasses = _useStatusClasses.classNames;
|
79
68
|
var onCloseHandler = function onCloseHandler() {
|
80
|
-
if (onClose) {
|
69
|
+
if (onClose && key) {
|
81
70
|
onClose(key);
|
82
71
|
}
|
83
72
|
};
|
@@ -87,7 +76,8 @@ var Message = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
87
76
|
innerHeight = _useState2[0],
|
88
77
|
setInnerHeight = _useState2[1];
|
89
78
|
(0, _react.useLayoutEffect)(function () {
|
90
|
-
|
79
|
+
var _innerRef$current$cli, _innerRef$current;
|
80
|
+
setInnerHeight((_innerRef$current$cli = (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.clientHeight) !== null && _innerRef$current$cli !== void 0 ? _innerRef$current$cli : 0);
|
91
81
|
}, [children]);
|
92
82
|
var _useStatusClasses3 = (0, _useStatusClasses4["default"])(className, {
|
93
83
|
isHidden: isHidden
|
@@ -145,25 +135,5 @@ var Message = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
145
135
|
color: color
|
146
136
|
}))));
|
147
137
|
});
|
148
|
-
Message.propTypes = {
|
149
|
-
item: _propTypes["default"].shape({
|
150
|
-
key: _propTypes["default"].string,
|
151
|
-
props: _propTypes["default"].shape({
|
152
|
-
children: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
153
|
-
/* Background color */
|
154
|
-
bg: _propTypes["default"].string,
|
155
|
-
/* Text color */
|
156
|
-
color: _propTypes["default"].string,
|
157
|
-
/* Message icon */
|
158
|
-
icon: _propTypes["default"].elementType,
|
159
|
-
/* Hides the message with an animated transition */
|
160
|
-
isHidden: _propTypes["default"].bool,
|
161
|
-
'data-id': _propTypes["default"].string,
|
162
|
-
status: _objectSpread({}, _statusProp.statusPropTypes).status
|
163
|
-
})
|
164
|
-
}),
|
165
|
-
/* Callback for clicking the message's close button */
|
166
|
-
onClose: _propTypes["default"].func
|
167
|
-
};
|
168
138
|
var _default = Message;
|
169
139
|
exports["default"] = _default;
|
@@ -0,0 +1,151 @@
|
|
1
|
+
export declare const messageCloseButton: {
|
2
|
+
p: number;
|
3
|
+
ml: string;
|
4
|
+
outline: string;
|
5
|
+
path: {
|
6
|
+
fill: string;
|
7
|
+
};
|
8
|
+
'&.is-hovered': {
|
9
|
+
bg: string;
|
10
|
+
boxShadow: string;
|
11
|
+
};
|
12
|
+
'&.is-pressed': {
|
13
|
+
boxShadow: string;
|
14
|
+
bg: string;
|
15
|
+
path: {
|
16
|
+
fill: string;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
'&.is-success': {
|
20
|
+
path: {
|
21
|
+
fill: string;
|
22
|
+
};
|
23
|
+
'&.is-pressed': {
|
24
|
+
boxShadow: string;
|
25
|
+
bg: string;
|
26
|
+
path: {
|
27
|
+
fill: string;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
};
|
31
|
+
'&.is-warning': {
|
32
|
+
path: {
|
33
|
+
fill: string;
|
34
|
+
};
|
35
|
+
'&.is-pressed': {
|
36
|
+
boxShadow: string;
|
37
|
+
bg: string;
|
38
|
+
path: {
|
39
|
+
fill: string;
|
40
|
+
};
|
41
|
+
};
|
42
|
+
};
|
43
|
+
'&.is-error': {
|
44
|
+
path: {
|
45
|
+
fill: string;
|
46
|
+
};
|
47
|
+
'&.is-pressed': {
|
48
|
+
boxShadow: string;
|
49
|
+
bg: string;
|
50
|
+
path: {
|
51
|
+
fill: string;
|
52
|
+
};
|
53
|
+
};
|
54
|
+
};
|
55
|
+
};
|
56
|
+
declare const _default: {
|
57
|
+
wrapper: {
|
58
|
+
position: string;
|
59
|
+
right: string;
|
60
|
+
bottom: string;
|
61
|
+
left: string;
|
62
|
+
alignItems: string;
|
63
|
+
pointerEvents: string;
|
64
|
+
};
|
65
|
+
transition: {
|
66
|
+
transition: string;
|
67
|
+
opacity: number;
|
68
|
+
'&.is-hidden': {
|
69
|
+
opacity: number;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
item: {
|
73
|
+
maxWidth: number;
|
74
|
+
pointerEvents: string;
|
75
|
+
mb: string;
|
76
|
+
p: string;
|
77
|
+
wordBreak: string;
|
78
|
+
alignItems: string;
|
79
|
+
bg: string;
|
80
|
+
color: string;
|
81
|
+
borderRadius: number;
|
82
|
+
'&.is-success, > .is-success': {
|
83
|
+
bg: string;
|
84
|
+
color: string;
|
85
|
+
};
|
86
|
+
'&.is-warning, > .is-warning': {
|
87
|
+
bg: string;
|
88
|
+
color: string;
|
89
|
+
};
|
90
|
+
'&.is-error, > .is-error': {
|
91
|
+
bg: string;
|
92
|
+
color: string;
|
93
|
+
};
|
94
|
+
};
|
95
|
+
messageCloseButton: {
|
96
|
+
p: number;
|
97
|
+
ml: string;
|
98
|
+
outline: string;
|
99
|
+
path: {
|
100
|
+
fill: string;
|
101
|
+
};
|
102
|
+
'&.is-hovered': {
|
103
|
+
bg: string;
|
104
|
+
boxShadow: string;
|
105
|
+
};
|
106
|
+
'&.is-pressed': {
|
107
|
+
boxShadow: string;
|
108
|
+
bg: string;
|
109
|
+
path: {
|
110
|
+
fill: string;
|
111
|
+
};
|
112
|
+
};
|
113
|
+
'&.is-success': {
|
114
|
+
path: {
|
115
|
+
fill: string;
|
116
|
+
};
|
117
|
+
'&.is-pressed': {
|
118
|
+
boxShadow: string;
|
119
|
+
bg: string;
|
120
|
+
path: {
|
121
|
+
fill: string;
|
122
|
+
};
|
123
|
+
};
|
124
|
+
};
|
125
|
+
'&.is-warning': {
|
126
|
+
path: {
|
127
|
+
fill: string;
|
128
|
+
};
|
129
|
+
'&.is-pressed': {
|
130
|
+
boxShadow: string;
|
131
|
+
bg: string;
|
132
|
+
path: {
|
133
|
+
fill: string;
|
134
|
+
};
|
135
|
+
};
|
136
|
+
};
|
137
|
+
'&.is-error': {
|
138
|
+
path: {
|
139
|
+
fill: string;
|
140
|
+
};
|
141
|
+
'&.is-pressed': {
|
142
|
+
boxShadow: string;
|
143
|
+
bg: string;
|
144
|
+
path: {
|
145
|
+
fill: string;
|
146
|
+
};
|
147
|
+
};
|
148
|
+
};
|
149
|
+
};
|
150
|
+
};
|
151
|
+
export default _default;
|
@@ -26,19 +26,16 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-c
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
27
27
|
var _collections = require("@react-stately/collections");
|
28
28
|
var _list = require("@react-stately/list");
|
29
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
30
|
-
var _statusProp = require("../../utils/docUtils/statusProp");
|
31
29
|
var _Box = _interopRequireDefault(require("../Box"));
|
32
30
|
var _Message = _interopRequireDefault(require("./Message"));
|
33
31
|
var _react2 = require("@emotion/react");
|
34
|
-
var _excluded = ["
|
32
|
+
var _excluded = ["onClose"];
|
35
33
|
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); }
|
36
34
|
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; }
|
37
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
38
36
|
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; }
|
39
37
|
var Messages = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
40
|
-
var
|
41
|
-
onClose = props.onClose,
|
38
|
+
var onClose = props.onClose,
|
42
39
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
43
40
|
var _useState = (0, _react.useState)([]),
|
44
41
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -82,16 +79,6 @@ var Messages = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
82
79
|
});
|
83
80
|
}));
|
84
81
|
});
|
85
|
-
Messages.propTypes = {
|
86
|
-
/* For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections). */
|
87
|
-
items: _propTypes["default"].arrayOf(_propTypes["default"].shape(_objectSpread({
|
88
|
-
key: _propTypes["default"].string,
|
89
|
-
text: _propTypes["default"].string,
|
90
|
-
node: _propTypes["default"].node
|
91
|
-
}, _statusProp.statusPropTypes))),
|
92
|
-
/* Callback for clicking the message's close button */
|
93
|
-
onClose: _propTypes["default"].func
|
94
|
-
};
|
95
82
|
Messages.defaultProps = {
|
96
83
|
items: []
|
97
84
|
};
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MessageItem } from '../../types';
|
3
|
+
declare const _default: {
|
4
|
+
title: string;
|
5
|
+
component: React.ForwardRefExoticComponent<import("../../index").MessagesProps<MessageItem> & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
decorators: ((...args: any) => any)[];
|
7
|
+
argTypes: {
|
8
|
+
items: {
|
9
|
+
control: {
|
10
|
+
type: string;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
onClose: {
|
14
|
+
control: {
|
15
|
+
type: string;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
};
|
19
|
+
parameters: {
|
20
|
+
docs: {
|
21
|
+
page: () => React.JSX.Element;
|
22
|
+
source: {
|
23
|
+
type: string;
|
24
|
+
};
|
25
|
+
};
|
26
|
+
};
|
27
|
+
};
|
28
|
+
export default _default;
|
29
|
+
export declare const Default: {
|
30
|
+
(args: any): React.JSX.Element;
|
31
|
+
parameters: {
|
32
|
+
design: {
|
33
|
+
type: string;
|
34
|
+
url: string;
|
35
|
+
};
|
36
|
+
};
|
37
|
+
};
|
38
|
+
export declare const DefaultDynamic: {
|
39
|
+
(args: any): React.JSX.Element;
|
40
|
+
parameters: {
|
41
|
+
a11y: {
|
42
|
+
config: {
|
43
|
+
rules: {
|
44
|
+
id: string;
|
45
|
+
enabled: boolean;
|
46
|
+
}[];
|
47
|
+
};
|
48
|
+
};
|
49
|
+
};
|
50
|
+
};
|
51
|
+
export declare const Controlled: {
|
52
|
+
(args: any): React.JSX.Element;
|
53
|
+
parameters: {
|
54
|
+
a11y: {
|
55
|
+
config: {
|
56
|
+
rules: {
|
57
|
+
id: string;
|
58
|
+
enabled: boolean;
|
59
|
+
}[];
|
60
|
+
};
|
61
|
+
};
|
62
|
+
};
|
63
|
+
};
|
64
|
+
export declare const ControlledWithButton: {
|
65
|
+
(args: any): React.JSX.Element;
|
66
|
+
parameters: {
|
67
|
+
a11y: {
|
68
|
+
config: {
|
69
|
+
rules: {
|
70
|
+
id: string;
|
71
|
+
enabled: boolean;
|
72
|
+
}[];
|
73
|
+
};
|
74
|
+
};
|
75
|
+
};
|
76
|
+
};
|
77
|
+
export declare const WithCustomColorsAndIcons: {
|
78
|
+
(args: any): React.JSX.Element;
|
79
|
+
parameters: {
|
80
|
+
a11y: {
|
81
|
+
config: {
|
82
|
+
rules: {
|
83
|
+
id: string;
|
84
|
+
enabled: boolean;
|
85
|
+
}[];
|
86
|
+
};
|
87
|
+
};
|
88
|
+
};
|
89
|
+
};
|
90
|
+
export declare const UseReducer: {
|
91
|
+
(): React.JSX.Element;
|
92
|
+
parameters: {
|
93
|
+
a11y: {
|
94
|
+
config: {
|
95
|
+
rules: {
|
96
|
+
id: string;
|
97
|
+
enabled: boolean;
|
98
|
+
}[];
|
99
|
+
};
|
100
|
+
};
|
101
|
+
};
|
102
|
+
};
|
103
|
+
export declare const UseReducerWithMultipleContainers: {
|
104
|
+
(): React.JSX.Element;
|
105
|
+
parameters: {
|
106
|
+
a11y: {
|
107
|
+
config: {
|
108
|
+
rules: {
|
109
|
+
id: string;
|
110
|
+
enabled: boolean;
|
111
|
+
}[];
|
112
|
+
};
|
113
|
+
};
|
114
|
+
};
|
115
|
+
};
|
116
|
+
export declare const WithTextStyling: {
|
117
|
+
(args: any): React.JSX.Element;
|
118
|
+
parameters: {
|
119
|
+
a11y: {
|
120
|
+
config: {
|
121
|
+
rules: {
|
122
|
+
id: string;
|
123
|
+
enabled: boolean;
|
124
|
+
}[];
|
125
|
+
};
|
126
|
+
};
|
127
|
+
};
|
128
|
+
};
|
@@ -29,7 +29,7 @@ var _AccountIcon = _interopRequireDefault(require("@pingux/mdi-react/AccountIcon
|
|
29
29
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
30
30
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
31
31
|
var _index = require("../../index");
|
32
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks
|
32
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
33
33
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
34
34
|
var _index2 = require("./index");
|
35
35
|
var _Messages = _interopRequireDefault(require("./Messages.mdx"));
|
@@ -73,15 +73,15 @@ var messages = [{
|
|
73
73
|
}, {
|
74
74
|
key: 'message2',
|
75
75
|
text: loremText,
|
76
|
-
status:
|
76
|
+
status: _statuses["default"].SUCCESS
|
77
77
|
}, {
|
78
78
|
key: 'message3',
|
79
79
|
text: loremText,
|
80
|
-
status:
|
80
|
+
status: _statuses["default"].WARNING
|
81
81
|
}, {
|
82
82
|
key: 'message4',
|
83
83
|
text: loremText,
|
84
|
-
status:
|
84
|
+
status: _statuses["default"].ERROR
|
85
85
|
}];
|
86
86
|
var Default = function Default(args) {
|
87
87
|
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
@@ -90,7 +90,7 @@ var Default = function Default(args) {
|
|
90
90
|
}, loremText), (0, _react2.jsx)(_reactStately.Item, {
|
91
91
|
key: "message2",
|
92
92
|
"data-id": "message2",
|
93
|
-
status: "
|
93
|
+
status: _statuses["default"].SUCCESS
|
94
94
|
}, loremText));
|
95
95
|
};
|
96
96
|
exports.Default = Default;
|
@@ -101,18 +101,26 @@ Default.parameters = {
|
|
101
101
|
}
|
102
102
|
};
|
103
103
|
var DefaultDynamic = function DefaultDynamic(args) {
|
104
|
-
return (
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
110
|
-
})
|
111
|
-
);
|
104
|
+
return (0, _react2.jsx)(_index.Messages, (0, _extends2["default"])({}, args, {
|
105
|
+
items: messages
|
106
|
+
}), function (item) {
|
107
|
+
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
108
|
+
});
|
112
109
|
};
|
110
|
+
|
111
|
+
// Added to bypass color contrast in safari
|
113
112
|
exports.DefaultDynamic = DefaultDynamic;
|
113
|
+
DefaultDynamic.parameters = {
|
114
|
+
a11y: {
|
115
|
+
config: {
|
116
|
+
rules: [{
|
117
|
+
id: 'color-contrast',
|
118
|
+
enabled: false
|
119
|
+
}]
|
120
|
+
}
|
121
|
+
}
|
122
|
+
};
|
114
123
|
var Controlled = function Controlled(args) {
|
115
|
-
// messages = [{...}]
|
116
124
|
var _useState = (0, _react.useState)([]),
|
117
125
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
118
126
|
items = _useState2[0],
|
@@ -139,7 +147,19 @@ var Controlled = function Controlled(args) {
|
|
139
147
|
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
140
148
|
});
|
141
149
|
};
|
150
|
+
|
151
|
+
// Added to bypass color contrast in safari
|
142
152
|
exports.Controlled = Controlled;
|
153
|
+
Controlled.parameters = {
|
154
|
+
a11y: {
|
155
|
+
config: {
|
156
|
+
rules: [{
|
157
|
+
id: 'color-contrast',
|
158
|
+
enabled: false
|
159
|
+
}]
|
160
|
+
}
|
161
|
+
}
|
162
|
+
};
|
143
163
|
var ControlledWithButton = function ControlledWithButton(args) {
|
144
164
|
var _useState3 = (0, _react.useState)([]),
|
145
165
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
@@ -174,7 +194,19 @@ var ControlledWithButton = function ControlledWithButton(args) {
|
|
174
194
|
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
175
195
|
}));
|
176
196
|
};
|
197
|
+
|
198
|
+
// Added to bypass color contrast in safari
|
177
199
|
exports.ControlledWithButton = ControlledWithButton;
|
200
|
+
ControlledWithButton.parameters = {
|
201
|
+
a11y: {
|
202
|
+
config: {
|
203
|
+
rules: [{
|
204
|
+
id: 'color-contrast',
|
205
|
+
enabled: false
|
206
|
+
}]
|
207
|
+
}
|
208
|
+
}
|
209
|
+
};
|
178
210
|
var WithCustomColorsAndIcons = function WithCustomColorsAndIcons(args) {
|
179
211
|
return (0, _react2.jsx)(_index.Messages, args, (0, _react2.jsx)(_reactStately.Item, {
|
180
212
|
bg: "accent.99",
|
@@ -182,7 +214,19 @@ var WithCustomColorsAndIcons = function WithCustomColorsAndIcons(args) {
|
|
182
214
|
icon: _AccountIcon["default"]
|
183
215
|
}, loremText));
|
184
216
|
};
|
217
|
+
|
218
|
+
// Added to bypass color contrast in safari
|
185
219
|
exports.WithCustomColorsAndIcons = WithCustomColorsAndIcons;
|
220
|
+
WithCustomColorsAndIcons.parameters = {
|
221
|
+
a11y: {
|
222
|
+
config: {
|
223
|
+
rules: [{
|
224
|
+
id: 'color-contrast',
|
225
|
+
enabled: false
|
226
|
+
}]
|
227
|
+
}
|
228
|
+
}
|
229
|
+
};
|
186
230
|
var UseReducer = function UseReducer() {
|
187
231
|
// import { messagesReducer as messagesReducerCore } from '@pingux/astro';
|
188
232
|
// const messagesReducer = messagesReducerCore;
|
@@ -197,7 +241,7 @@ var UseReducer = function UseReducer() {
|
|
197
241
|
// showWarningMessage: makeShowMessage('warning', -1),
|
198
242
|
// };
|
199
243
|
|
200
|
-
var _useReducer = (0, _react.useReducer)(_index2.messagesReducerStory),
|
244
|
+
var _useReducer = (0, _react.useReducer)(_index2.messagesReducerStory, []),
|
201
245
|
_useReducer2 = (0, _slicedToArray2["default"])(_useReducer, 2),
|
202
246
|
items = _useReducer2[0],
|
203
247
|
dispatch = _useReducer2[1];
|
@@ -225,7 +269,19 @@ var UseReducer = function UseReducer() {
|
|
225
269
|
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
226
270
|
}));
|
227
271
|
};
|
272
|
+
|
273
|
+
// Added to bypass color contrast in safari
|
228
274
|
exports.UseReducer = UseReducer;
|
275
|
+
UseReducer.parameters = {
|
276
|
+
a11y: {
|
277
|
+
config: {
|
278
|
+
rules: [{
|
279
|
+
id: 'color-contrast',
|
280
|
+
enabled: false
|
281
|
+
}]
|
282
|
+
}
|
283
|
+
}
|
284
|
+
};
|
229
285
|
var UseReducerWithMultipleContainers = function UseReducerWithMultipleContainers() {
|
230
286
|
var _useReducer3 = (0, _react.useReducer)(_index2.multiMessagesReducerStory, {
|
231
287
|
'container-one': [],
|
@@ -277,7 +333,19 @@ var UseReducerWithMultipleContainers = function UseReducerWithMultipleContainers
|
|
277
333
|
return (0, _react2.jsx)(_reactStately.Item, item, item.text);
|
278
334
|
}));
|
279
335
|
};
|
336
|
+
|
337
|
+
// Added to bypass color contrast in safari
|
280
338
|
exports.UseReducerWithMultipleContainers = UseReducerWithMultipleContainers;
|
339
|
+
UseReducerWithMultipleContainers.parameters = {
|
340
|
+
a11y: {
|
341
|
+
config: {
|
342
|
+
rules: [{
|
343
|
+
id: 'color-contrast',
|
344
|
+
enabled: false
|
345
|
+
}]
|
346
|
+
}
|
347
|
+
}
|
348
|
+
};
|
281
349
|
var WithTextStyling = function WithTextStyling(args) {
|
282
350
|
var items = [{
|
283
351
|
key: 'message1',
|
@@ -301,4 +369,16 @@ var WithTextStyling = function WithTextStyling(args) {
|
|
301
369
|
return (0, _react2.jsx)(_reactStately.Item, item, item.node || item.text);
|
302
370
|
});
|
303
371
|
};
|
304
|
-
|
372
|
+
|
373
|
+
// Added to bypass color contrast in safari
|
374
|
+
exports.WithTextStyling = WithTextStyling;
|
375
|
+
WithTextStyling.parameters = {
|
376
|
+
a11y: {
|
377
|
+
config: {
|
378
|
+
rules: [{
|
379
|
+
id: 'color-contrast',
|
380
|
+
enabled: false
|
381
|
+
}]
|
382
|
+
}
|
383
|
+
}
|
384
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|