@pingux/astro 2.54.0-alpha.2 → 2.54.0-alpha.4
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 +1 -2
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +3 -2
- package/lib/cjs/components/Button/Button.js +2 -4
- package/lib/cjs/components/CheckboxField/CheckboxField.js +2 -4
- package/lib/cjs/components/ColorField/ColorField.js +2 -4
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +2 -4
- package/lib/cjs/components/DatePicker/DatePicker.js +2 -4
- package/lib/cjs/components/FileInputField/FileInputField.js +2 -4
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +7 -7
- package/lib/cjs/components/IconButton/IconButton.js +2 -4
- package/lib/cjs/components/IconButton/IconButton.styles.d.ts +1 -72
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +2 -4
- package/lib/cjs/components/Input/Input.js +6 -7
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +2 -4
- package/lib/cjs/components/ListViewItem/ListViewItem.js +2 -4
- package/lib/cjs/components/Messages/Message.js +46 -16
- package/lib/cjs/components/Messages/Messages.js +15 -2
- package/lib/cjs/components/Messages/Messages.reducer.js +51 -0
- package/lib/cjs/components/Messages/Messages.stories.js +16 -96
- package/lib/cjs/components/Messages/Messages.test.js +9 -9
- package/lib/cjs/components/Messages/index.js +3 -2
- package/lib/cjs/components/Messages/utils/messagesReducer.js +15 -29
- package/lib/cjs/components/Messages/utils/multiMessagesReducer.js +14 -20
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.js +3 -4
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.js +2 -3
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -2
- package/lib/cjs/components/NumberField/NumberField.js +1 -2
- package/lib/cjs/components/PasswordField/PasswordField.js +2 -4
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +2 -4
- package/lib/cjs/components/SearchField/SearchField.js +2 -4
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +1 -2
- package/lib/cjs/components/SwitchField/SwitchField.js +3 -5
- package/lib/cjs/components/Tab/Tab.js +1 -2
- package/lib/cjs/components/TextAreaField/TextAreaField.js +2 -4
- package/lib/cjs/components/TextField/TextField.js +2 -4
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.js +1 -2
- package/lib/cjs/types/index.d.ts +0 -1
- package/lib/cjs/types/index.js +14 -25
- package/lib/cjs/types/item.d.ts +0 -2
- package/lib/components/ArrayField/ArrayField.js +1 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +3 -2
- package/lib/components/Button/Button.js +2 -4
- package/lib/components/CheckboxField/CheckboxField.js +2 -4
- package/lib/components/ColorField/ColorField.js +2 -4
- package/lib/components/ComboBoxField/ComboBoxField.js +2 -4
- package/lib/components/DatePicker/DatePicker.js +2 -4
- package/lib/components/FileInputField/FileInputField.js +2 -4
- package/lib/components/HelpHint/HelpHint.stories.js +7 -7
- package/lib/components/IconButton/IconButton.js +2 -4
- package/lib/components/ImageUploadField/ImageUploadField.js +2 -4
- package/lib/components/Input/Input.js +5 -6
- package/lib/components/LinkSelectField/LinkSelectField.js +2 -4
- package/lib/components/ListViewItem/ListViewItem.js +2 -4
- package/lib/components/Messages/Message.js +46 -14
- package/lib/components/Messages/Messages.js +15 -2
- package/lib/components/Messages/Messages.reducer.js +41 -0
- package/lib/components/Messages/Messages.stories.js +15 -95
- package/lib/components/Messages/Messages.test.js +9 -9
- package/lib/components/Messages/index.js +1 -1
- package/lib/components/Messages/utils/messagesReducer.js +13 -27
- package/lib/components/Messages/utils/multiMessagesReducer.js +10 -20
- package/lib/components/Messages/utils/tests/messagesReducer.test.js +3 -4
- package/lib/components/Messages/utils/tests/multiMessagesReducer.test.js +8 -9
- package/lib/components/MultivaluesField/MultivaluesField.js +4 -3
- package/lib/components/NumberField/NumberField.js +1 -2
- package/lib/components/PasswordField/PasswordField.js +2 -4
- package/lib/components/RadioGroupField/RadioGroupField.js +2 -4
- package/lib/components/SearchField/SearchField.js +2 -4
- package/lib/components/SelectFieldBase/SelectFieldBase.js +1 -2
- package/lib/components/SwitchField/SwitchField.js +3 -5
- package/lib/components/Tab/Tab.js +1 -2
- package/lib/components/TextAreaField/TextAreaField.js +2 -4
- package/lib/components/TextField/TextField.js +2 -4
- package/lib/components/TimeZonePicker/TimeZonePicker.js +1 -2
- package/lib/types/index.js +0 -1
- package/package.json +1 -1
- package/lib/cjs/components/Messages/Message.d.ts +0 -9
- package/lib/cjs/components/Messages/Message.styles.d.ts +0 -151
- package/lib/cjs/components/Messages/Messages.d.ts +0 -4
- package/lib/cjs/components/Messages/Messages.stories.d.ts +0 -128
- package/lib/cjs/components/Messages/Messages.test.d.ts +0 -1
- package/lib/cjs/components/Messages/index.d.ts +0 -3
- package/lib/cjs/components/Messages/utils/index.d.ts +0 -2
- package/lib/cjs/components/Messages/utils/messagesReducer.d.ts +0 -107
- package/lib/cjs/components/Messages/utils/multiMessagesReducer.d.ts +0 -83
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.d.ts +0 -1
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.d.ts +0 -1
- package/lib/cjs/types/messages.d.ts +0 -43
- package/lib/cjs/types/messages.js +0 -6
- package/lib/cjs/utils/devUtils/constants/pendoID.d.ts +0 -3
- package/lib/cjs/utils/devUtils/constants/pendoID.js +0 -13
- package/lib/types/messages.js +0 -1
- package/lib/utils/devUtils/constants/pendoID.js +0 -5
@@ -21,7 +21,6 @@ import { mergeProps, useLabel } from 'react-aria';
|
|
21
21
|
import PropTypes from 'prop-types';
|
22
22
|
import { v4 as uuid } from 'uuid';
|
23
23
|
import { Box, Button, FieldHelperText, Label, Text } from '../..';
|
24
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
25
24
|
import statuses from '../../utils/devUtils/constants/statuses';
|
26
25
|
import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
|
27
26
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
@@ -120,7 +119,7 @@ var ArrayField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
120
119
|
var _getAriaAttributeProp = getAriaAttributeProps(others),
|
121
120
|
ariaProps = _getAriaAttributeProp.ariaProps,
|
122
121
|
nonAriaProps = _getAriaAttributeProp.nonAriaProps;
|
123
|
-
return ___EmotionJSX(Box, _extends({},
|
122
|
+
return ___EmotionJSX(Box, _extends({}, nonAriaProps, {
|
124
123
|
ref: ref
|
125
124
|
}), ___EmotionJSX(Label, _extends({}, raLabelProps, mergeProps(labelProps, raLabelProps, {
|
126
125
|
children: label
|
@@ -26,7 +26,7 @@ var Breadcrumbs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
26
|
var breadcrumbsRef = useLocalOrForwardRef(ref);
|
27
27
|
usePropWarning(props, 'disabled', 'isDisabled');
|
28
28
|
var createBreadcrumb = useCallback(function (child, idx) {
|
29
|
-
var isCurrentItem = _Array$isArray(filteredChildren) && filteredChildren.length > 1 ? idx ===
|
29
|
+
var isCurrentItem = idx && _Array$isArray(children) && _Array$isArray(filteredChildren) && filteredChildren.length > 1 ? idx === children.length - 1 : true;
|
30
30
|
return ___EmotionJSX(React.Fragment, {
|
31
31
|
key: "li-".concat(child.key)
|
32
32
|
}, ___EmotionJSX(BreadcrumbItem, _extends({
|
@@ -51,10 +51,11 @@ test('should render nodes from the children', function () {
|
|
51
51
|
test('should render correct amount of icons', function () {
|
52
52
|
getComponent({
|
53
53
|
iconProps: {
|
54
|
-
'data-testid': testIconId
|
54
|
+
'data-testid': testIconId,
|
55
|
+
icon: ChevronRightIcon
|
55
56
|
}
|
56
57
|
});
|
57
|
-
expect(screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length -
|
58
|
+
expect(screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length - 2);
|
58
59
|
});
|
59
60
|
test('breadcrumbItem should render breadcrumbItem as a Text component when appropriate elementType passed', function () {
|
60
61
|
getComponent({}, {
|
@@ -17,10 +17,8 @@ import { mergeProps, useButton, useFocusRing } from 'react-aria';
|
|
17
17
|
import { Pressable, useHover, usePress } from '@react-aria/interactions';
|
18
18
|
import { Button as ThemeUIButton } from 'theme-ui';
|
19
19
|
import { useAriaLabelWarning, useLocalOrForwardRef, usePropWarning, useStatusClasses } from '../../hooks';
|
20
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
21
20
|
import Loader from '../Loader';
|
22
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
23
|
-
var displayName = 'Button';
|
24
22
|
var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
25
23
|
var children = props.children,
|
26
24
|
className = props.className,
|
@@ -93,7 +91,7 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
93
91
|
alignItems: 'center'
|
94
92
|
} : {},
|
95
93
|
variant: variant
|
96
|
-
},
|
94
|
+
}, others, mergeProps(_objectSpread(_objectSpread({}, buttonProps), {}, {
|
97
95
|
tabIndex: tabIndex
|
98
96
|
}), hoverProps, focusProps)), isLoading ? ___EmotionJSX("span", {
|
99
97
|
style: {
|
@@ -110,5 +108,5 @@ Button.defaultProps = {
|
|
110
108
|
isDisabled: false,
|
111
109
|
variant: 'default'
|
112
110
|
};
|
113
|
-
Button.displayName =
|
111
|
+
Button.displayName = 'Button';
|
114
112
|
export default Button;
|
@@ -18,12 +18,10 @@ import PropTypes from 'prop-types';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
19
19
|
import { Box, Checkbox, FieldHelperText, Label } from '../..';
|
20
20
|
import { useField, usePropWarning } from '../../hooks';
|
21
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
22
21
|
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
23
22
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
24
23
|
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
25
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
26
|
-
var displayName = 'CheckboxField';
|
27
25
|
var CheckboxField = /*#__PURE__*/forwardRef(function (props, ref) {
|
28
26
|
var label = props.label,
|
29
27
|
_props$controlProps = props.controlProps,
|
@@ -70,7 +68,7 @@ var CheckboxField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
70
68
|
var helperTextId = useMemo(function () {
|
71
69
|
return uuid();
|
72
70
|
}, []);
|
73
|
-
return ___EmotionJSX(Box,
|
71
|
+
return ___EmotionJSX(Box, fieldContainerProps, ___EmotionJSX(Label, _extends({
|
74
72
|
variant: "forms.label.checkbox"
|
75
73
|
}, fieldLabelProps), ___EmotionJSX(Checkbox, _extends({
|
76
74
|
ref: checkboxRef,
|
@@ -126,5 +124,5 @@ CheckboxField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
126
124
|
/** Handler that is called when a key is released. */
|
127
125
|
onKeyUp: PropTypes.func
|
128
126
|
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
129
|
-
CheckboxField.displayName =
|
127
|
+
CheckboxField.displayName = 'CheckboxField';
|
130
128
|
export default CheckboxField;
|
@@ -20,13 +20,11 @@ import { useColorFieldState } from '@react-stately/color';
|
|
20
20
|
import PropTypes from 'prop-types';
|
21
21
|
import { Box, Button, FieldHelperText, Input, Label } from '../..';
|
22
22
|
import useField from '../../hooks/useField';
|
23
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
24
23
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
25
24
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
26
25
|
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
27
26
|
import PopoverContainer from '../PopoverContainer';
|
28
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
|
-
var displayName = 'ColorField';
|
30
28
|
var ColorField = /*#__PURE__*/forwardRef(function (props, ref) {
|
31
29
|
var _context;
|
32
30
|
var align = props.align,
|
@@ -93,7 +91,7 @@ var ColorField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
93
91
|
var colorValue = _ref.colorValue;
|
94
92
|
return _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = "rgba(".concat(colorValue === null || colorValue === void 0 ? void 0 : colorValue.red, ", ")).call(_context4, colorValue === null || colorValue === void 0 ? void 0 : colorValue.green, ", ")).call(_context3, colorValue === null || colorValue === void 0 ? void 0 : colorValue.blue, ", ")).call(_context2, colorValue === null || colorValue === void 0 ? void 0 : colorValue.alpha, ")");
|
95
93
|
}, []);
|
96
|
-
return ___EmotionJSX(Box,
|
94
|
+
return ___EmotionJSX(Box, fieldContainerProps, label && ___EmotionJSX(Label, fieldLabelProps), ___EmotionJSX(Button, _extends({
|
97
95
|
"aria-label": "Select color",
|
98
96
|
bg: getRgbaFromState(state),
|
99
97
|
onPress: handleButtonPress,
|
@@ -146,5 +144,5 @@ ColorField.defaultProps = {
|
|
146
144
|
align: 'middle',
|
147
145
|
direction: 'bottom'
|
148
146
|
};
|
149
|
-
ColorField.displayName =
|
147
|
+
ColorField.displayName = 'ColorField';
|
150
148
|
export default ColorField;
|
@@ -25,7 +25,6 @@ import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
|
25
25
|
import PropTypes from 'prop-types';
|
26
26
|
import { usePropWarning } from '../../hooks';
|
27
27
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
28
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
29
28
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
30
29
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
31
30
|
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
@@ -34,7 +33,6 @@ import ListBox from '../ListBox';
|
|
34
33
|
import PopoverContainer from '../PopoverContainer';
|
35
34
|
import ScrollBox from '../ScrollBox';
|
36
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
37
|
-
var displayName = 'ComboBoxField';
|
38
36
|
var ComboBoxField = /*#__PURE__*/forwardRef(function (props, ref) {
|
39
37
|
var hasAutoFocus = props.hasAutoFocus,
|
40
38
|
hasAddOption = props.hasAddOption,
|
@@ -200,7 +198,7 @@ var ComboBoxField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
200
198
|
}, otherListBoxProps))), ___EmotionJSX(DismissButton, {
|
201
199
|
onDismiss: state.close
|
202
200
|
})));
|
203
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ComboBoxInput, _extends({},
|
201
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ComboBoxInput, _extends({}, props, {
|
204
202
|
isOpen: state.isOpen,
|
205
203
|
inputProps: inputProps,
|
206
204
|
labelProps: labelProps,
|
@@ -339,5 +337,5 @@ ComboBoxField.defaultProps = {
|
|
339
337
|
},
|
340
338
|
defaultItems: []
|
341
339
|
};
|
342
|
-
ComboBoxField.displayName =
|
340
|
+
ComboBoxField.displayName = 'ComboBoxField';
|
343
341
|
export default ComboBoxField;
|
@@ -18,10 +18,8 @@ import { FocusScope } from '@react-aria/focus';
|
|
18
18
|
import { useOverlayPosition } from '@react-aria/overlays';
|
19
19
|
import { mergeProps } from '@react-aria/utils';
|
20
20
|
import { useDatePickerState } from '@react-stately/datepicker';
|
21
|
-
import { omit } from 'lodash/object';
|
22
21
|
import PropTypes from 'prop-types';
|
23
22
|
import { Calendar, FieldHelperText, PopoverContainer } from '../../index';
|
24
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
25
23
|
import statuses from '../../utils/devUtils/constants/statuses';
|
26
24
|
import { isDateWithinRanges } from '../../utils/devUtils/props/isDateWithinRanges';
|
27
25
|
import DateField from './DateField';
|
@@ -98,11 +96,11 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
98
96
|
contain: true,
|
99
97
|
restoreFocus: true
|
100
98
|
}, ___EmotionJSX(Calendar, calendarProps)));
|
101
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DateField, _extends({},
|
99
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DateField, _extends({}, props, {
|
102
100
|
ref: ref,
|
103
101
|
buttonProps: buttonProps,
|
104
102
|
fieldProps: fieldProps,
|
105
|
-
groupProps:
|
103
|
+
groupProps: groupProps,
|
106
104
|
groupRef: groupRef,
|
107
105
|
helperText: helperText,
|
108
106
|
labelProps: labelProps,
|
@@ -27,7 +27,6 @@ import { v4 as uuidv4 } from 'uuid';
|
|
27
27
|
import { Box, FieldHelperText, Input, Label, Loader } from '../..';
|
28
28
|
import useField from '../../hooks/useField';
|
29
29
|
import useStatusClasses from '../../hooks/useStatusClasses';
|
30
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
31
30
|
import statuses from '../../utils/devUtils/constants/statuses';
|
32
31
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
33
32
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
@@ -35,7 +34,6 @@ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusP
|
|
35
34
|
import FileItem from './FileItem';
|
36
35
|
import FileSelect from './FileSelect';
|
37
36
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
38
|
-
var displayName = 'FileInputField';
|
39
37
|
var FILE_CHANGE_STATUS = {
|
40
38
|
ADDED: 'added',
|
41
39
|
DELETED: 'deleted'
|
@@ -196,7 +194,7 @@ var FileInputField = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
196
194
|
fieldContainerProps: fieldContainerProps
|
197
195
|
}, ___EmotionJSX(Label, fieldLabelProps), ___EmotionJSX(Box, _extends({
|
198
196
|
variant: "forms.fileInputField.wrapper"
|
199
|
-
},
|
197
|
+
}, mergeProps(fieldControlWrapperProps, nonAriaProps), {
|
200
198
|
className: classNames
|
201
199
|
}, getRootProps(), {
|
202
200
|
// to pass accessibility test, this removes focusable dependents
|
@@ -229,7 +227,7 @@ var FileInputField = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
229
227
|
role: "status"
|
230
228
|
}, ___EmotionJSX(VisuallyHidden, null, ___EmotionJSX("h1", null, fileChangeMessage))));
|
231
229
|
});
|
232
|
-
FileInputField.displayName =
|
230
|
+
FileInputField.displayName = 'FileInputField';
|
233
231
|
FileInputField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
234
232
|
/** The rendered label for the field. */
|
235
233
|
label: PropTypes.node,
|
@@ -26,12 +26,12 @@ export default {
|
|
26
26
|
}
|
27
27
|
},
|
28
28
|
args: {
|
29
|
-
children: '
|
29
|
+
children: 'Text of the popover right here...'
|
30
30
|
}
|
31
31
|
};
|
32
32
|
export var Default = function Default(args) {
|
33
33
|
return ___EmotionJSX(Box, {
|
34
|
-
p:
|
34
|
+
p: 50
|
35
35
|
}, ___EmotionJSX(HelpHint, args));
|
36
36
|
};
|
37
37
|
Default.parameters = {
|
@@ -42,7 +42,7 @@ Default.parameters = {
|
|
42
42
|
};
|
43
43
|
export var WithPopoverAndIconButtonProps = function WithPopoverAndIconButtonProps() {
|
44
44
|
return ___EmotionJSX(Box, {
|
45
|
-
p:
|
45
|
+
p: 50
|
46
46
|
}, ___EmotionJSX(HelpHint, {
|
47
47
|
popoverProps: {
|
48
48
|
'data-testid': 'popover-container'
|
@@ -51,14 +51,14 @@ export var WithPopoverAndIconButtonProps = function WithPopoverAndIconButtonProp
|
|
51
51
|
'aria-label': 'Help hint'
|
52
52
|
},
|
53
53
|
direction: "bottom"
|
54
|
-
}, "
|
54
|
+
}, "Text of the popover right here..."));
|
55
55
|
};
|
56
56
|
export var ContentWithLink = function ContentWithLink() {
|
57
57
|
return ___EmotionJSX(Box, {
|
58
|
-
p:
|
58
|
+
p: 70
|
59
59
|
}, ___EmotionJSX(HelpHint, null, ___EmotionJSX(Text, {
|
60
60
|
variant: "popover"
|
61
|
-
}, "
|
61
|
+
}, "Text of the popover right here... "), ___EmotionJSX(Link, {
|
62
62
|
variant: "popover",
|
63
63
|
href: "https://uilibrary.ping-eng.com/",
|
64
64
|
target: "_blank"
|
@@ -72,7 +72,7 @@ ContentWithLink.parameters = {
|
|
72
72
|
};
|
73
73
|
export var WithDelay = function WithDelay(args) {
|
74
74
|
return ___EmotionJSX(Box, {
|
75
|
-
p:
|
75
|
+
p: 50
|
76
76
|
}, ___EmotionJSX(HelpHint, _extends({}, args, {
|
77
77
|
closeDelay: 5000
|
78
78
|
})));
|
@@ -18,10 +18,8 @@ import { Pressable, useHover, usePress } from '@react-aria/interactions';
|
|
18
18
|
import { IconButton as ThemeUIIconButton } from 'theme-ui';
|
19
19
|
import { BadgeContext } from '../../context/BadgeContext';
|
20
20
|
import { useAriaLabelWarning, useStatusClasses } from '../../hooks';
|
21
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
22
21
|
import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
|
23
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
24
|
-
var displayName = 'IconButton';
|
25
23
|
var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
26
24
|
var children = props.children,
|
27
25
|
className = props.className,
|
@@ -88,7 +86,7 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
88
86
|
useAriaLabelWarning('IconButton', ariaLabel);
|
89
87
|
var button = ___EmotionJSX(Pressable, _extends({
|
90
88
|
ref: buttonRef
|
91
|
-
},
|
89
|
+
}, mergeProps(buttonProps, others, hoverProps, focusProps)), ___EmotionJSX(ThemeUIIconButton, {
|
92
90
|
tabIndex: 0,
|
93
91
|
className: classNames,
|
94
92
|
"aria-label": ariaLabel,
|
@@ -111,5 +109,5 @@ IconButton.defaultProps = {
|
|
111
109
|
variant: 'base',
|
112
110
|
isDisabled: false
|
113
111
|
};
|
114
|
-
IconButton.displayName =
|
112
|
+
IconButton.displayName = 'IconButton';
|
115
113
|
export default IconButton;
|
@@ -16,14 +16,12 @@ import PropTypes from 'prop-types';
|
|
16
16
|
import { v4 as uuid } from 'uuid';
|
17
17
|
import { Item, Menu } from '../..';
|
18
18
|
import { useImageUploadState } from '../../hooks/useImageUploadState';
|
19
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
20
19
|
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
21
20
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
22
21
|
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
23
22
|
import ImagePreviewButton from './ImagePreviewButton';
|
24
23
|
import ImageUploadFieldBase from './ImageUploadFieldBase';
|
25
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
26
|
-
var displayName = 'ImageUploadField';
|
27
25
|
var ImageUploadField = /*#__PURE__*/forwardRef(function (props, ref) {
|
28
26
|
var isLoading = props.isLoading,
|
29
27
|
loaderSize = props.loaderSize,
|
@@ -64,7 +62,7 @@ var ImageUploadField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
64
62
|
isMenuOpen: state.isMenuOpen,
|
65
63
|
ref: inputRef,
|
66
64
|
widthHeightSx: state.widthHeightSx
|
67
|
-
},
|
65
|
+
}, props), ___EmotionJSX(ImagePreviewButton, {
|
68
66
|
defaultPreviewImage: state.defaultPreviewImage,
|
69
67
|
defaultPreviewNode: state.defaultPreviewNode,
|
70
68
|
isImageType: state.isImageType,
|
@@ -137,5 +135,5 @@ ImageUploadField.defaultProps = {
|
|
137
135
|
uploadItemText: 'Upload New Image',
|
138
136
|
removeItemText: 'Remove Image'
|
139
137
|
};
|
140
|
-
ImageUploadField.displayName =
|
138
|
+
ImageUploadField.displayName = 'ImageUploadField';
|
141
139
|
export default ImageUploadField;
|
@@ -5,7 +5,7 @@ var _excluded = ["name", "placeholder", "maxLength"];
|
|
5
5
|
import React, { forwardRef } from 'react';
|
6
6
|
import { flexbox, layout, typography } from 'styled-system';
|
7
7
|
import { Input as ThemeUIInput } from 'theme-ui';
|
8
|
-
import {
|
8
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
9
|
/**
|
10
10
|
* Base input component.
|
11
11
|
*
|
@@ -16,14 +16,13 @@ import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
|
16
16
|
* We instead encourage developers to utilize our Field components wherever possible.
|
17
17
|
* If this component is used, accessibility is left to the developer.
|
18
18
|
*/
|
19
|
-
|
20
|
-
var displayName = 'Input';
|
19
|
+
|
21
20
|
var ExtendedInput = /*#__PURE__*/_styled(ThemeUIInput, process.env.NODE_ENV === "production" ? {
|
22
21
|
target: "e1lpwkt50"
|
23
22
|
} : {
|
24
23
|
target: "e1lpwkt50",
|
25
24
|
label: "ExtendedInput"
|
26
|
-
})(layout, flexbox, typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
25
|
+
})(layout, flexbox, typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0lucHV0L0lucHV0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQnNCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0lucHV0L0lucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZmxleGJveCwgbGF5b3V0LCB0eXBvZ3JhcGh5IH0gZnJvbSAnc3R5bGVkLXN5c3RlbSc7XG5pbXBvcnQgeyBJbnB1dCBhcyBUaGVtZVVJSW5wdXQgfSBmcm9tICd0aGVtZS11aSc7XG5cbmltcG9ydCB7IElucHV0UHJvcHMgfSBmcm9tICcuLi8uLi90eXBlcyc7XG4vKipcbiAqIEJhc2UgaW5wdXQgY29tcG9uZW50LlxuICpcbiAqIEFjY2VwdHMgcmVsZXZhbnQgc3R5bGluZyBwcm9wcyBmcm9tIFtzdHlsZWQtc3lzdGVtXShodHRwczovL3N0eWxlZC1zeXN0ZW0uY29tL3RhYmxlKS5cbiAqIEJ1aWx0IG9uIHRvcCBvZiBbSW5wdXQgZnJvbSBUaGVtZS1VSV0oaHR0cHM6Ly90aGVtZS11aS5jb20vY29tcG9uZW50cy9pbnB1dC8pLlxuICpcbiAqICoqTm90ZSoqOiBUaGlzIGNvbXBvbmVudCBkb2VzIG5vdCBzdXBwbHkgYWxsIG9mIHRoZSBhY2Nlc3NpYmlsaXR5IGFzc2lzdGFuY2Ugb24gaXRzIG93bi5cbiAqIFdlIGluc3RlYWQgZW5jb3VyYWdlIGRldmVsb3BlcnMgdG8gdXRpbGl6ZSBvdXIgRmllbGQgY29tcG9uZW50cyB3aGVyZXZlciBwb3NzaWJsZS5cbiAqIElmIHRoaXMgY29tcG9uZW50IGlzIHVzZWQsIGFjY2Vzc2liaWxpdHkgaXMgbGVmdCB0byB0aGUgZGV2ZWxvcGVyLlxuICovXG5cbmNvbnN0IEV4dGVuZGVkSW5wdXQgPSBzdHlsZWQoVGhlbWVVSUlucHV0KShcbiAgbGF5b3V0LFxuICBmbGV4Ym94LFxuICB0eXBvZ3JhcGh5LFxuKTtcblxuY29uc3QgSW5wdXQgPSBmb3J3YXJkUmVmPEhUTUxJbnB1dEVsZW1lbnQsIElucHV0UHJvcHM+KChwcm9wcywgcmVmKSA9PiB7XG4gIGNvbnN0IHsgbmFtZSwgcGxhY2Vob2xkZXIsIG1heExlbmd0aCwgLi4ub3RoZXJzIH0gPSBwcm9wcztcblxuICByZXR1cm4gKFxuICAgIDxFeHRlbmRlZElucHV0XG4gICAgICByZWY9e3JlZn1cbiAgICAgIG5hbWU9e25hbWV9XG4gICAgICBwbGFjZWhvbGRlcj17cGxhY2Vob2xkZXJ9XG4gICAgICBtYXhMZW5ndGg9e21heExlbmd0aCAmJiBtYXhMZW5ndGh9XG4gICAgICB7Li4ub3RoZXJzfVxuICAgIC8+XG4gICk7XG59KTtcblxuSW5wdXQuZGlzcGxheU5hbWUgPSAnSW5wdXQnO1xuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcbiJdfQ== */");
|
27
26
|
var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
28
27
|
var name = props.name,
|
29
28
|
placeholder = props.placeholder,
|
@@ -34,7 +33,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
33
|
name: name,
|
35
34
|
placeholder: placeholder,
|
36
35
|
maxLength: maxLength && maxLength
|
37
|
-
},
|
36
|
+
}, others));
|
38
37
|
});
|
39
|
-
Input.displayName =
|
38
|
+
Input.displayName = 'Input';
|
40
39
|
export default Input;
|
@@ -18,14 +18,12 @@ import PropTypes from 'prop-types';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
19
19
|
import { Box, Button, Icon, Loader, Text } from '../..';
|
20
20
|
import { usePropWarning, useSelectField } from '../../hooks';
|
21
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
22
21
|
import statuses from '../../utils/devUtils/constants/statuses';
|
23
22
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
24
23
|
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
25
24
|
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
26
25
|
import SelectFieldBase from '../SelectFieldBase';
|
27
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
28
|
-
var displayName = 'LinkSelectField';
|
29
27
|
var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
30
28
|
var placeholder = props.placeholder,
|
31
29
|
isDisabled = props.isDisabled,
|
@@ -54,7 +52,7 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
54
52
|
ref: triggerRef,
|
55
53
|
variant: "link",
|
56
54
|
tabIndex: isDisabled ? -1 : 0
|
57
|
-
},
|
55
|
+
}, triggerProps, ariaProps, {
|
58
56
|
"aria-describedby": helperText && helperTextId
|
59
57
|
}), ___EmotionJSX(Text, {
|
60
58
|
variant: "label",
|
@@ -151,5 +149,5 @@ LinkSelectField.defaultProps = _objectSpread({
|
|
151
149
|
align: 'start',
|
152
150
|
direction: 'bottom'
|
153
151
|
}, statusDefaultProp);
|
154
|
-
LinkSelectField.displayName =
|
152
|
+
LinkSelectField.displayName = 'LinkSelectField';
|
155
153
|
export default LinkSelectField;
|
@@ -6,11 +6,9 @@ import React, { forwardRef } from 'react';
|
|
6
6
|
import { useHover } from '@react-aria/interactions';
|
7
7
|
import { Box, Icon, Image, Text } from '../..';
|
8
8
|
import { useStatusClasses } from '../../hooks';
|
9
|
-
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
10
9
|
import { listViewItemPropTypes } from './listViewItemAttributes';
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
11
|
export var LIST_ITEM_ICON = '-list-item-icon';
|
13
|
-
var displayName = 'ListViewItem';
|
14
12
|
var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
15
13
|
var _context;
|
16
14
|
var children = _ref.children,
|
@@ -77,7 +75,7 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
77
75
|
className: classNames,
|
78
76
|
ref: ref,
|
79
77
|
variant: "listViewItem.styledContainer"
|
80
|
-
}, hoverProps,
|
78
|
+
}, hoverProps, others), ___EmotionJSX(Box, {
|
81
79
|
isRow: true,
|
82
80
|
variant: getWrapperVariant()
|
83
81
|
}, renderData, (slots === null || slots === void 0 ? void 0 : slots.rightOfData) && ___EmotionJSX(Box, {
|
@@ -90,5 +88,5 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
90
88
|
}, children)));
|
91
89
|
});
|
92
90
|
ListViewItem.propTypes = listViewItemPropTypes;
|
93
|
-
ListViewItem.displayName =
|
91
|
+
ListViewItem.displayName = 'ListViewItem';
|
94
92
|
export default ListViewItem;
|
@@ -1,13 +1,24 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
1
9
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
3
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
4
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
5
13
|
var _excluded = ["color"];
|
14
|
+
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; }
|
15
|
+
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) { _defineProperty(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; }
|
6
16
|
import React, { forwardRef, useLayoutEffect, useRef, useState } from 'react';
|
7
17
|
import CloseIcon from '@pingux/mdi-react/CloseIcon';
|
18
|
+
import PropTypes from 'prop-types';
|
8
19
|
import { Box, Icon, IconButton, Text } from '../..';
|
9
20
|
import useStatusClasses from '../../hooks/useStatusClasses';
|
10
|
-
import
|
21
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
11
22
|
import { NoticeIcon } from '../Icon/NoticeIcon';
|
12
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
24
|
export var ARIA_STATUSES = {
|
@@ -33,26 +44,28 @@ var CloseButton = function CloseButton(_ref) {
|
|
33
44
|
}
|
34
45
|
}));
|
35
46
|
};
|
47
|
+
CloseButton.propTypes = {
|
48
|
+
color: PropTypes.string
|
49
|
+
};
|
36
50
|
var Message = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
37
51
|
var className = _ref2.className,
|
38
52
|
item = _ref2.item,
|
39
53
|
onClose = _ref2.onClose;
|
40
54
|
var key = item.key,
|
41
55
|
itemProps = item.props;
|
42
|
-
var
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
dataId = _ref3['data-id'];
|
56
|
+
var children = itemProps.children,
|
57
|
+
_itemProps$status = itemProps.status,
|
58
|
+
status = _itemProps$status === void 0 ? 'default' : _itemProps$status,
|
59
|
+
bg = itemProps.bg,
|
60
|
+
color = itemProps.color,
|
61
|
+
icon = itemProps.icon,
|
62
|
+
_itemProps$isHidden = itemProps.isHidden,
|
63
|
+
isHidden = _itemProps$isHidden === void 0 ? false : _itemProps$isHidden,
|
64
|
+
dataId = itemProps['data-id'];
|
52
65
|
var _useStatusClasses = useStatusClasses(className, _defineProperty({}, "is-".concat(status), true)),
|
53
66
|
statusClasses = _useStatusClasses.classNames;
|
54
67
|
var onCloseHandler = function onCloseHandler() {
|
55
|
-
if (onClose
|
68
|
+
if (onClose) {
|
56
69
|
onClose(key);
|
57
70
|
}
|
58
71
|
};
|
@@ -62,8 +75,7 @@ var Message = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
62
75
|
innerHeight = _useState2[0],
|
63
76
|
setInnerHeight = _useState2[1];
|
64
77
|
useLayoutEffect(function () {
|
65
|
-
|
66
|
-
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);
|
78
|
+
setInnerHeight(innerRef.current.clientHeight);
|
67
79
|
}, [children]);
|
68
80
|
var _useStatusClasses3 = useStatusClasses(className, {
|
69
81
|
isHidden: isHidden
|
@@ -121,4 +133,24 @@ var Message = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
121
133
|
color: color
|
122
134
|
}))));
|
123
135
|
});
|
136
|
+
Message.propTypes = {
|
137
|
+
item: PropTypes.shape({
|
138
|
+
key: PropTypes.string,
|
139
|
+
props: PropTypes.shape({
|
140
|
+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
141
|
+
/* Background color */
|
142
|
+
bg: PropTypes.string,
|
143
|
+
/* Text color */
|
144
|
+
color: PropTypes.string,
|
145
|
+
/* Message icon */
|
146
|
+
icon: PropTypes.elementType,
|
147
|
+
/* Hides the message with an animated transition */
|
148
|
+
isHidden: PropTypes.bool,
|
149
|
+
'data-id': PropTypes.string,
|
150
|
+
status: _objectSpread({}, statusPropTypes).status
|
151
|
+
})
|
152
|
+
}),
|
153
|
+
/* Callback for clicking the message's close button */
|
154
|
+
onClose: PropTypes.func
|
155
|
+
};
|
124
156
|
export default Message;
|
@@ -9,7 +9,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
11
11
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
12
|
-
var _excluded = ["onClose"];
|
12
|
+
var _excluded = ["items", "onClose"];
|
13
13
|
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; }
|
14
14
|
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) { _defineProperty(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; }
|
15
15
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
@@ -19,11 +19,14 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
19
19
|
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
20
20
|
import { useCollection } from '@react-stately/collections';
|
21
21
|
import { ListCollection } from '@react-stately/list';
|
22
|
+
import PropTypes from 'prop-types';
|
23
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
22
24
|
import Box from '../Box';
|
23
25
|
import Message from './Message';
|
24
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
25
27
|
var Messages = /*#__PURE__*/forwardRef(function (props, ref) {
|
26
|
-
var
|
28
|
+
var items = props.items,
|
29
|
+
onClose = props.onClose,
|
27
30
|
others = _objectWithoutProperties(props, _excluded);
|
28
31
|
var _useState = useState([]),
|
29
32
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -67,6 +70,16 @@ var Messages = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
67
70
|
});
|
68
71
|
}));
|
69
72
|
});
|
73
|
+
Messages.propTypes = {
|
74
|
+
/* For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections). */
|
75
|
+
items: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
76
|
+
key: PropTypes.string,
|
77
|
+
text: PropTypes.string,
|
78
|
+
node: PropTypes.node
|
79
|
+
}, statusPropTypes))),
|
80
|
+
/* Callback for clicking the message's close button */
|
81
|
+
onClose: PropTypes.func
|
82
|
+
};
|
70
83
|
Messages.defaultProps = {
|
71
84
|
items: []
|
72
85
|
};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
+
function ownKeys(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; }
|
11
|
+
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) { _defineProperty(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; }
|
12
|
+
import { messagesReducer as messagesReducerCore, multiMessagesReducer as multiMessagesReducerCore } from './utils';
|
13
|
+
export var messagesReducer = messagesReducerCore;
|
14
|
+
export var multiMessagesReducer = multiMessagesReducerCore;
|
15
|
+
var makeShowMessage = function makeShowMessage(status, timeout) {
|
16
|
+
return function (text) {
|
17
|
+
return messagesReducer.actions.showMessage({
|
18
|
+
text: text,
|
19
|
+
status: status
|
20
|
+
}, timeout);
|
21
|
+
};
|
22
|
+
};
|
23
|
+
var makeMultiShowMessage = function makeMultiShowMessage(status, timeout) {
|
24
|
+
return function (container, text) {
|
25
|
+
return multiMessagesReducer.actions.showMessage(container, {
|
26
|
+
text: text,
|
27
|
+
status: status
|
28
|
+
}, timeout);
|
29
|
+
};
|
30
|
+
};
|
31
|
+
messagesReducer.actions = _objectSpread(_objectSpread({}, messagesReducer.actions), {}, {
|
32
|
+
showSuccessMessage: makeShowMessage('success', 3000),
|
33
|
+
showErrorMessage: makeShowMessage('error', -1),
|
34
|
+
showWarningMessage: makeShowMessage('warning', -1)
|
35
|
+
});
|
36
|
+
multiMessagesReducer.actions = _objectSpread(_objectSpread({}, multiMessagesReducer.actions), {}, {
|
37
|
+
showSuccessMessage: makeMultiShowMessage('success', 3000),
|
38
|
+
showCriticalMessage: makeMultiShowMessage('error', -1),
|
39
|
+
showWarningMessage: makeMultiShowMessage('warning', -1)
|
40
|
+
});
|
41
|
+
export default messagesReducer;
|