@pingux/astro 2.219.0 → 2.220.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/Breadcrumbs/Breadcrumb.styles.d.ts +7 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumb.styles.js +9 -2
- package/lib/cjs/components/Breadcrumbs/BreadcrumbItem.js +16 -3
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +24 -7
- package/lib/cjs/components/DatePicker/DateField.d.ts +4 -0
- package/lib/cjs/components/DatePicker/DateField.js +25 -79
- package/lib/cjs/components/DatePicker/DatePicker.d.ts +4 -0
- package/lib/cjs/components/DatePicker/DatePicker.js +28 -79
- package/lib/cjs/components/DatePicker/DatePicker.stories.js +4 -2
- package/lib/cjs/components/DatePicker/DatePicker.styles.d.ts +921 -0
- package/lib/cjs/components/DatePicker/DatePicker.styles.js +3 -1
- package/lib/cjs/components/DatePicker/DatePicker.test.js +4 -4
- package/lib/cjs/components/DatePicker/DateSegment.d.ts +7 -0
- package/lib/cjs/components/DatePicker/DateSegment.js +18 -29
- package/lib/cjs/components/DatePicker/index.d.ts +1 -0
- package/lib/cjs/components/Icon/NoticeIcon.d.ts +16 -1
- package/lib/cjs/components/IconButton/IconButton.styles.d.ts +39 -1
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.d.ts +18 -0
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +3 -22
- package/lib/cjs/components/ImageUploadField/ImageUploadField.d.ts +4 -0
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +30 -66
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.d.ts +17 -0
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +6 -19
- package/lib/cjs/components/ImageUploadField/imageUpload.d.ts +53 -0
- package/lib/cjs/components/ImageUploadField/index.d.ts +1 -0
- package/lib/cjs/components/PanelHeader/PanelHeader.styles.js +4 -1
- package/lib/cjs/components/SwitchField/switchFieldAttributes.d.ts +7 -2
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +138 -119
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +10 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +10 -0
- package/lib/cjs/styles/themeOverrides/onyxSideNav.d.ts +10 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +10 -1
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +10 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +10 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +10 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +13 -1
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +3 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +3 -0
- package/lib/cjs/types/breadCrumbs.d.ts +6 -0
- package/lib/cjs/types/datePicker.d.ts +112 -0
- package/lib/cjs/types/datePicker.js +6 -0
- package/lib/cjs/types/imageUploadField.d.ts +31 -0
- package/lib/cjs/types/imageUploadField.js +6 -0
- package/lib/cjs/types/index.d.ts +2 -0
- package/lib/cjs/types/index.js +73 -51
- package/lib/cjs/utils/devUtils/constants/statuses.d.ts +17 -0
- package/lib/cjs/utils/devUtils/props/isDateWithinRanges.d.ts +10 -0
- package/lib/cjs/utils/devUtils/props/isDateWithinRanges.js +2 -2
- package/lib/components/Breadcrumbs/Breadcrumb.styles.js +9 -2
- package/lib/components/Breadcrumbs/BreadcrumbItem.js +17 -4
- package/lib/components/Breadcrumbs/Breadcrumbs.js +25 -8
- package/lib/components/DatePicker/DateField.js +25 -79
- package/lib/components/DatePicker/DatePicker.js +30 -79
- package/lib/components/DatePicker/DatePicker.stories.js +4 -2
- package/lib/components/DatePicker/DatePicker.styles.js +3 -1
- package/lib/components/DatePicker/DatePicker.test.js +4 -4
- package/lib/components/DatePicker/DateSegment.js +17 -30
- package/lib/components/ImageUploadField/ImagePreviewButton.js +5 -24
- package/lib/components/ImageUploadField/ImageUploadField.js +31 -67
- package/lib/components/ImageUploadField/ImageUploadFieldBase.js +6 -19
- package/lib/components/PanelHeader/PanelHeader.styles.js +4 -1
- package/lib/styles/themes/next-gen/variants/variants.js +3 -0
- package/lib/types/datePicker.js +1 -0
- package/lib/types/imageUploadField.js +1 -0
- package/lib/types/index.js +2 -0
- package/lib/utils/devUtils/props/isDateWithinRanges.js +2 -3
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["children", "icon", "iconProps", "onAction"];
|
|
4
5
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
5
6
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
6
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
|
-
import React, { forwardRef, useCallback } from 'react';
|
|
8
|
+
import React, { forwardRef, useCallback, useState } from 'react';
|
|
8
9
|
import { mergeProps, useBreadcrumbs } from 'react-aria';
|
|
9
10
|
import { useGetTheme, useLocalOrForwardRef, usePropWarning } from '../../hooks';
|
|
10
11
|
import { Box, Icon } from '../../index';
|
|
@@ -17,8 +18,7 @@ var Breadcrumbs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
17
18
|
onAction = props.onAction,
|
|
18
19
|
others = _objectWithoutProperties(props, _excluded);
|
|
19
20
|
var _useGetTheme = useGetTheme(),
|
|
20
|
-
breadcrumbIconSize = _useGetTheme.breadcrumbIconSize
|
|
21
|
-
breadcrumbIconMargin = _useGetTheme.breadcrumbIconMargin;
|
|
21
|
+
breadcrumbIconSize = _useGetTheme.breadcrumbIconSize;
|
|
22
22
|
|
|
23
23
|
// the following filters undefined values passed as a child
|
|
24
24
|
var filteredChildren = _Array$isArray(children) ? _filterInstanceProperty(children).call(children, function (child) {
|
|
@@ -27,19 +27,30 @@ var Breadcrumbs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
27
27
|
var _useBreadcrumbs = useBreadcrumbs(props),
|
|
28
28
|
wrapperProps = _useBreadcrumbs.navProps;
|
|
29
29
|
var breadcrumbsRef = useLocalOrForwardRef(ref);
|
|
30
|
+
var _useState = useState(null),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
hoveredKey = _useState2[0],
|
|
33
|
+
setHoveredKey = _useState2[1];
|
|
30
34
|
usePropWarning(props, 'disabled', 'isDisabled');
|
|
31
35
|
var createBreadcrumb = useCallback(function (child, idx) {
|
|
32
36
|
var isCurrentItem = _Array$isArray(filteredChildren) && filteredChildren.length > 1 ? idx === React.Children.toArray(children).length - 1 : true;
|
|
37
|
+
var handleTooltipHoverChange = function handleTooltipHoverChange(isHovering) {
|
|
38
|
+
setHoveredKey(function (prevKey) {
|
|
39
|
+
if (isHovering) return child.key;
|
|
40
|
+
return prevKey === child.key ? null : prevKey;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
33
43
|
return ___EmotionJSX(React.Fragment, {
|
|
34
44
|
key: "li-".concat(child.key)
|
|
35
45
|
}, ___EmotionJSX(BreadcrumbItem, _extends({
|
|
36
46
|
actionKey: child.key,
|
|
37
47
|
"data-id": child['data-id'],
|
|
38
48
|
isCurrent: isCurrentItem,
|
|
39
|
-
|
|
49
|
+
isTooltipOpen: hoveredKey === child.key,
|
|
50
|
+
onAction: onAction,
|
|
51
|
+
onTooltipHoverChange: handleTooltipHoverChange
|
|
40
52
|
}, child.props), child.props.children), icon && !isCurrentItem && ___EmotionJSX(Icon, _extends({
|
|
41
53
|
"aria-hidden": "true",
|
|
42
|
-
mx: breadcrumbIconMargin,
|
|
43
54
|
size: breadcrumbIconSize,
|
|
44
55
|
title: {
|
|
45
56
|
name: 'Breadcrumb Separator'
|
|
@@ -48,9 +59,15 @@ var Breadcrumbs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
48
59
|
color: "text.primary",
|
|
49
60
|
icon: icon
|
|
50
61
|
})));
|
|
51
|
-
}, [_Array$isArray(children) && children.length, filteredChildren, icon, iconProps, onAction]);
|
|
52
|
-
return ___EmotionJSX(
|
|
53
|
-
|
|
62
|
+
}, [_Array$isArray(children) && children.length, filteredChildren, icon, iconProps, onAction, hoveredKey]);
|
|
63
|
+
return ___EmotionJSX(Box, {
|
|
64
|
+
as: "nav",
|
|
65
|
+
"aria-label": "Breadcrumb",
|
|
66
|
+
sx: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
minWidth: 0,
|
|
69
|
+
width: '100%'
|
|
70
|
+
}
|
|
54
71
|
}, ___EmotionJSX(Box, _extends({
|
|
55
72
|
as: "ol",
|
|
56
73
|
isRow: true,
|
|
@@ -9,13 +9,12 @@ 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 = ["buttonProps", "className", "fieldProps", "groupProps", "groupRef", "hasFormatHelpText", "helperText", "isDisabled", "isOpen", "isReadOnly", "isRequired", "status", "datePickerState", "minValue", "maxValue", "unavailableRanges", "fieldControlProps"],
|
|
12
|
+
var _excluded = ["buttonProps", "className", "fieldProps", "groupProps", "groupRef", "hasFormatHelpText", "helperText", "isDisabled", "isOpen", "isReadOnly", "isRequired", "isQuiet", "status", "datePickerState", "minValue", "maxValue", "unavailableRanges", "fieldControlProps", "hasAutoFocus"],
|
|
13
13
|
_excluded2 = ["defaultValue"];
|
|
14
14
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
15
15
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
16
16
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
17
17
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
18
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
|
19
18
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
20
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
@@ -27,7 +26,6 @@ import { useDateField } from '@react-aria/datepicker';
|
|
|
27
26
|
import { useLocale } from '@react-aria/i18n';
|
|
28
27
|
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
29
28
|
import { useDateFieldState } from '@react-stately/datepicker';
|
|
30
|
-
import PropTypes from 'prop-types';
|
|
31
29
|
import { useField, useStatusClasses } from '../../hooks';
|
|
32
30
|
import { Box, FieldHelperText, Icon, IconButton, Input, Label, Messages } from '../../index';
|
|
33
31
|
import statuses from '../../utils/devUtils/constants/statuses';
|
|
@@ -51,24 +49,32 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
49
|
groupRef = props.groupRef,
|
|
52
50
|
hasFormatHelpText = props.hasFormatHelpText,
|
|
53
51
|
helperText = props.helperText,
|
|
54
|
-
isDisabled = props.isDisabled,
|
|
52
|
+
_props$isDisabled = props.isDisabled,
|
|
53
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
55
54
|
isOpen = props.isOpen,
|
|
56
|
-
isReadOnly = props.isReadOnly,
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
_props$isReadOnly = props.isReadOnly,
|
|
56
|
+
isReadOnly = _props$isReadOnly === void 0 ? false : _props$isReadOnly,
|
|
57
|
+
_props$isRequired = props.isRequired,
|
|
58
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
59
|
+
_props$isQuiet = props.isQuiet,
|
|
60
|
+
isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet,
|
|
61
|
+
_props$status = props.status,
|
|
62
|
+
status = _props$status === void 0 ? statuses.DEFAULT : _props$status,
|
|
59
63
|
datePickerState = props.datePickerState,
|
|
60
64
|
minValue = props.minValue,
|
|
61
65
|
maxValue = props.maxValue,
|
|
62
66
|
unavailableRanges = props.unavailableRanges,
|
|
63
67
|
fieldControlProps = props.fieldControlProps,
|
|
68
|
+
_props$hasAutoFocus = props.hasAutoFocus,
|
|
69
|
+
hasAutoFocus = _props$hasAutoFocus === void 0 ? false : _props$hasAutoFocus,
|
|
64
70
|
other = _objectWithoutProperties(props, _excluded);
|
|
65
71
|
var _useState = useState(''),
|
|
66
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
67
73
|
errorMessage = _useState2[0],
|
|
68
74
|
setErrorMessage = _useState2[1];
|
|
69
|
-
var fieldRef = useRef();
|
|
70
|
-
var inputRef = useRef();
|
|
71
|
-
var labelRef = useRef();
|
|
75
|
+
var fieldRef = useRef(null);
|
|
76
|
+
var inputRef = useRef(null);
|
|
77
|
+
var labelRef = useRef(null);
|
|
72
78
|
|
|
73
79
|
// istanbul ignore next
|
|
74
80
|
useImperativeHandle(ref, function () {
|
|
@@ -86,7 +92,8 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
86
92
|
}, "is-".concat(status), true)),
|
|
87
93
|
classNames = _useStatusClasses.classNames;
|
|
88
94
|
var segments = state.segments;
|
|
89
|
-
var
|
|
95
|
+
var _ref = datePickerState || {},
|
|
96
|
+
setValue = _ref.setValue;
|
|
90
97
|
var _useDateField = useDateField(_objectSpread({}, fieldProps), state, fieldRef),
|
|
91
98
|
dateFieldProps = _useDateField.fieldProps;
|
|
92
99
|
|
|
@@ -97,7 +104,7 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
97
104
|
var defaultValue = props.defaultValue,
|
|
98
105
|
others = _objectWithoutProperties(props, _excluded2);
|
|
99
106
|
var _useField = useField(_objectSpread(_objectSpread({}, others), {}, {
|
|
100
|
-
value: state.value
|
|
107
|
+
value: state.value ? String(state.value) : ''
|
|
101
108
|
})),
|
|
102
109
|
fieldContainerProps = _useField.fieldContainerProps,
|
|
103
110
|
fieldControlInputProps = _useField.fieldControlInputProps,
|
|
@@ -163,7 +170,7 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
163
170
|
var copiedValue = e.clipboardData.getData('text');
|
|
164
171
|
var isNextAvailableDate;
|
|
165
172
|
var handleSetDateValue = function handleSetDateValue(isDate) {
|
|
166
|
-
setValue(isDate);
|
|
173
|
+
if (setValue) setValue(isDate);
|
|
167
174
|
};
|
|
168
175
|
if (isLocalEnUS && !isDisabled && !isReadOnly) {
|
|
169
176
|
try {
|
|
@@ -177,10 +184,10 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
177
184
|
// pastes the min/max/isNextAvailable date if the pasted value is
|
|
178
185
|
// min date, beyond max date or is an unavailable date.
|
|
179
186
|
|
|
180
|
-
if (DateProps.isValidDate <= DateProps.isMinValue) {
|
|
187
|
+
if (DateProps.isMinValue && DateProps.isValidDate <= DateProps.isMinValue) {
|
|
181
188
|
return handleSetDateValue(DateProps.isMinValue);
|
|
182
189
|
}
|
|
183
|
-
if (DateProps.isValidDate >= DateProps.isMaxValue) {
|
|
190
|
+
if (DateProps.isMaxValue && DateProps.isValidDate >= DateProps.isMaxValue) {
|
|
184
191
|
return handleSetDateValue(DateProps.isMaxValue);
|
|
185
192
|
}
|
|
186
193
|
if (unavailableRanges) {
|
|
@@ -216,10 +223,11 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
216
223
|
className: classNames
|
|
217
224
|
}), ___EmotionJSX(Box, fieldControlWrapperProps, ___EmotionJSX(VisuallyHidden, null, ___EmotionJSX(Input, _extends({
|
|
218
225
|
ref: inputRef,
|
|
219
|
-
tabIndex: -1,
|
|
220
226
|
type: "date/text",
|
|
221
227
|
"data-testid": "date-field"
|
|
222
|
-
},
|
|
228
|
+
}, _objectSpread({
|
|
229
|
+
tabIndex: -1
|
|
230
|
+
}, fieldControlInputProps), {
|
|
223
231
|
"aria-labelledby": labelRef === null || labelRef === void 0 || (_labelRef$current = labelRef.current) === null || _labelRef$current === void 0 ? void 0 : _labelRef$current.id
|
|
224
232
|
})))), ___EmotionJSX(Box, _extends({
|
|
225
233
|
isRow: true,
|
|
@@ -260,66 +268,4 @@ var DateField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
260
268
|
status: "error"
|
|
261
269
|
}, errorMessage)));
|
|
262
270
|
});
|
|
263
|
-
DateField.propTypes = {
|
|
264
|
-
/** Prop to provide a custom default date (uncontrolled) */
|
|
265
|
-
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
266
|
-
/** Prop to provide a default date (controlled) */
|
|
267
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
268
|
-
/** Props object that is spread directly into the calendar button element. */
|
|
269
|
-
buttonProps: PropTypes.shape({}),
|
|
270
|
-
/** Props object that is spread directly into the root (top-level) element. */
|
|
271
|
-
containerProps: PropTypes.shape({}),
|
|
272
|
-
/** state management for a date picker component */
|
|
273
|
-
datePickerState: PropTypes.shape({
|
|
274
|
-
setValue: PropTypes.func
|
|
275
|
-
}),
|
|
276
|
-
/** @ignore Props object that is spread directly into the segmented date field. */
|
|
277
|
-
fieldProps: PropTypes.shape({}),
|
|
278
|
-
/** @ignore Props passed to the box surrounding the input, button, and helper text. */
|
|
279
|
-
groupProps: PropTypes.shape({}),
|
|
280
|
-
/** @ignore Ref which is passed to the role="group" element. */
|
|
281
|
-
groupRef: PropTypes.shape({}),
|
|
282
|
-
/** Whether the input element is automatically focused when loaded onto the page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus). */
|
|
283
|
-
hasAutoFocus: PropTypes.bool,
|
|
284
|
-
/** Text rendered below the input displaying the expected date format for the user's locale. */
|
|
285
|
-
hasFormatHelpText: PropTypes.bool,
|
|
286
|
-
/** Text rendered below the input. */
|
|
287
|
-
helperText: PropTypes.node,
|
|
288
|
-
/** Props object that is spread directly into the helphint element. */
|
|
289
|
-
helpHintProps: PropTypes.shape({}),
|
|
290
|
-
/** Whether the field is disabled. */
|
|
291
|
-
isDisabled: PropTypes.bool,
|
|
292
|
-
/** Whether the overlay is currently open. */
|
|
293
|
-
isOpen: PropTypes.bool,
|
|
294
|
-
/** Whether the input can be selected, but not changed by the user. */
|
|
295
|
-
isReadOnly: PropTypes.bool,
|
|
296
|
-
/** Whether the field is required. */
|
|
297
|
-
isRequired: PropTypes.bool,
|
|
298
|
-
/** Whether the field is quiet. */
|
|
299
|
-
isQuiet: PropTypes.bool,
|
|
300
|
-
/** Props object that is spread directly into the label element. */
|
|
301
|
-
labelProps: PropTypes.shape({}),
|
|
302
|
-
/** The maximum allowed date that a user may select. */
|
|
303
|
-
maxValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
304
|
-
/** The minimum allowed date that a user may select. */
|
|
305
|
-
minValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
306
|
-
/** Handler that is called when the element's selection state changes. */
|
|
307
|
-
onChange: PropTypes.func,
|
|
308
|
-
/** Determines the input status indicator and helper text styling. */
|
|
309
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
|
310
|
-
/** The ranges of unavailable dates passed */
|
|
311
|
-
unavailableRanges: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)),
|
|
312
|
-
/** Props object that is spread directly into the input wrapper element. */
|
|
313
|
-
wrapperProps: PropTypes.shape({}),
|
|
314
|
-
/** Props object that spread into date segment wrapper element. */
|
|
315
|
-
fieldControlProps: PropTypes.shape({})
|
|
316
|
-
};
|
|
317
|
-
DateField.defaultProps = {
|
|
318
|
-
hasAutoFocus: false,
|
|
319
|
-
isDisabled: false,
|
|
320
|
-
isQuiet: false,
|
|
321
|
-
isReadOnly: false,
|
|
322
|
-
isRequired: false,
|
|
323
|
-
status: statuses.DEFAULT
|
|
324
|
-
};
|
|
325
271
|
export default DateField;
|
|
@@ -8,7 +8,6 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
|
12
11
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
13
|
import React, { forwardRef, useRef } from 'react';
|
|
@@ -18,26 +17,38 @@ import { FocusScope } from '@react-aria/focus';
|
|
|
18
17
|
import { mergeProps } from '@react-aria/utils';
|
|
19
18
|
import { useDatePickerState } from '@react-stately/datepicker';
|
|
20
19
|
import { omit } from 'lodash/object';
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
20
|
import { Calendar, FieldHelperText } from '../../index';
|
|
23
|
-
import Popover from '../Popover/Popover';
|
|
24
21
|
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
|
25
|
-
import statuses from '../../utils/devUtils/constants/statuses';
|
|
26
22
|
import { isDateWithinRanges } from '../../utils/devUtils/props/isDateWithinRanges';
|
|
23
|
+
import Popover from '../Popover/Popover';
|
|
27
24
|
import DateField from './DateField';
|
|
28
25
|
|
|
29
26
|
/**
|
|
30
27
|
* Console Warning: The state update warning is a known issue coming from the react-aria library.
|
|
31
28
|
* The `is-selected` class is added to the button after the component unmounts.
|
|
32
29
|
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Parse a prop that may be a DateValue object or a date string.
|
|
33
|
+
* Strings are parsed with parseDate.
|
|
34
|
+
*/
|
|
33
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
36
|
+
var parseDateProp = function parseDateProp(val) {
|
|
37
|
+
if (!val) return undefined;
|
|
38
|
+
return typeof val === 'string' ? parseDate(val) : val;
|
|
39
|
+
};
|
|
34
40
|
var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
35
41
|
var defaultValue = props.defaultValue,
|
|
36
42
|
hasAutoFocus = props.hasAutoFocus,
|
|
37
43
|
helperText = props.helperText,
|
|
38
44
|
helpHintProps = props.helpHintProps,
|
|
39
45
|
isDefaultOpen = props.isDefaultOpen,
|
|
40
|
-
|
|
46
|
+
_props$isDisabled = props.isDisabled,
|
|
47
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
48
|
+
_props$isReadOnly = props.isReadOnly,
|
|
49
|
+
isReadOnly = _props$isReadOnly === void 0 ? false : _props$isReadOnly,
|
|
50
|
+
_props$isRequired = props.isRequired,
|
|
51
|
+
isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
|
|
41
52
|
maxValue = props.maxValue,
|
|
42
53
|
minValue = props.minValue,
|
|
43
54
|
status = props.status,
|
|
@@ -45,8 +56,8 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
45
56
|
unavailableRanges = props.unavailableRanges,
|
|
46
57
|
fieldControlProps = props.fieldControlProps,
|
|
47
58
|
calendarWrapperProps = props.calendarWrapperProps;
|
|
48
|
-
var groupRef = useRef();
|
|
49
|
-
var popoverRef = useRef();
|
|
59
|
+
var groupRef = useRef(null);
|
|
60
|
+
var popoverRef = useRef(null);
|
|
50
61
|
|
|
51
62
|
/**
|
|
52
63
|
* This function is run against each date in the calendar
|
|
@@ -59,11 +70,11 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
59
70
|
* To accept date value as an object or as a string in format YYYY-MM-DD
|
|
60
71
|
*/
|
|
61
72
|
var parsedDates = {
|
|
62
|
-
value:
|
|
63
|
-
defaultValue:
|
|
64
|
-
maxValue:
|
|
65
|
-
minValue:
|
|
66
|
-
isDateUnavailable: unavailableRanges
|
|
73
|
+
value: parseDateProp(value),
|
|
74
|
+
defaultValue: parseDateProp(defaultValue),
|
|
75
|
+
maxValue: parseDateProp(maxValue),
|
|
76
|
+
minValue: parseDateProp(minValue),
|
|
77
|
+
isDateUnavailable: unavailableRanges ? isDateUnavailable : undefined
|
|
67
78
|
};
|
|
68
79
|
var state = useDatePickerState(_objectSpread({
|
|
69
80
|
autoFocus: hasAutoFocus,
|
|
@@ -87,13 +98,17 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
98
|
state: state,
|
|
88
99
|
offset: 15,
|
|
89
100
|
crossOffset: 40,
|
|
90
|
-
"data-testid": "popover-container"
|
|
91
|
-
|
|
101
|
+
"data-testid": "popover-container"
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
,
|
|
104
|
+
overflow: 'auto'
|
|
92
105
|
}, ___EmotionJSX(FocusScope, {
|
|
93
106
|
autoFocus: true,
|
|
94
107
|
contain: true,
|
|
95
108
|
restoreFocus: true
|
|
96
|
-
}, ___EmotionJSX("div", dialogProps, ___EmotionJSX(Calendar
|
|
109
|
+
}, ___EmotionJSX("div", dialogProps, ___EmotionJSX(Calendar
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
, _extends({}, calendarProps, {
|
|
97
112
|
calendarWrapperProps: calendarWrapperProps
|
|
98
113
|
})))));
|
|
99
114
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DateField, _extends({}, getPendoID('DatePicker'), props, {
|
|
@@ -113,68 +128,4 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
113
128
|
status: status
|
|
114
129
|
}, helperText));
|
|
115
130
|
});
|
|
116
|
-
DatePicker.propTypes = {
|
|
117
|
-
/** Prop to provide a custom default date (uncontrolled) */
|
|
118
|
-
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
119
|
-
/** Prop to provide a default date (controlled) */
|
|
120
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
121
|
-
/** Whether the element should receive focus on render. */
|
|
122
|
-
hasAutoFocus: PropTypes.bool,
|
|
123
|
-
/** Text rendered below the input displaying the expected date format for the user's locale. */
|
|
124
|
-
hasFormatHelpText: PropTypes.bool,
|
|
125
|
-
/** Text rendered below the input. */
|
|
126
|
-
helperText: PropTypes.string,
|
|
127
|
-
/** Props object that is spread directly into the helphint element. */
|
|
128
|
-
helpHintProps: PropTypes.shape({}),
|
|
129
|
-
/** The element's unique identifier. */
|
|
130
|
-
id: PropTypes.string,
|
|
131
|
-
/**
|
|
132
|
-
* Callback that is called for each date of the calendar.
|
|
133
|
-
* If it returns true, then the date is unavailable.
|
|
134
|
-
*
|
|
135
|
-
* (date: DateValue) => boolean
|
|
136
|
-
*/
|
|
137
|
-
isDateUnavailable: PropTypes.func,
|
|
138
|
-
/** Sets the default open state of the overlay (uncontrolled). */
|
|
139
|
-
isDefaultOpen: PropTypes.bool,
|
|
140
|
-
/** Whether the calendar is disabled. */
|
|
141
|
-
isDisabled: PropTypes.bool,
|
|
142
|
-
/** Whether the overlay is currently open (controlled). */
|
|
143
|
-
isOpen: PropTypes.bool,
|
|
144
|
-
/** Whether the calendar dates are only focusable. */
|
|
145
|
-
isReadOnly: PropTypes.bool,
|
|
146
|
-
/** Whether user input is required on the input before form submission. */
|
|
147
|
-
isRequired: PropTypes.bool,
|
|
148
|
-
/** The rendered label for the field. */
|
|
149
|
-
label: PropTypes.node,
|
|
150
|
-
/** The maximum allowed date that a user may select. */
|
|
151
|
-
maxValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
152
|
-
/** The minimum allowed date that a user may select. */
|
|
153
|
-
minValue: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
154
|
-
/** Handler that is called when the element loses focus. */
|
|
155
|
-
onBlur: PropTypes.func,
|
|
156
|
-
/** Handler that is called when the element's selection state changes. */
|
|
157
|
-
onChange: PropTypes.func,
|
|
158
|
-
/** Handler that is called when the element receives focus. */
|
|
159
|
-
onFocus: PropTypes.func,
|
|
160
|
-
/** Handler that is called when the element's focus status changes. */
|
|
161
|
-
onFocusChange: PropTypes.func,
|
|
162
|
-
/** Handler that is called when a key is pressed. */
|
|
163
|
-
onKeyDown: PropTypes.func,
|
|
164
|
-
/** Handler that is called when a key is released. */
|
|
165
|
-
onKeyUp: PropTypes.func,
|
|
166
|
-
/** Determines the textarea status indicator and helper text styling. */
|
|
167
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
|
168
|
-
/** The ranges of unavailable dates passed */
|
|
169
|
-
unavailableRanges: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)),
|
|
170
|
-
/** Props object that spread into date segment wrapper element. */
|
|
171
|
-
fieldControlProps: PropTypes.shape({}),
|
|
172
|
-
/** Props object that spread into calendar element. */
|
|
173
|
-
calendarWrapperProps: PropTypes.shape({})
|
|
174
|
-
};
|
|
175
|
-
DateField.defaultProps = {
|
|
176
|
-
isDisabled: false,
|
|
177
|
-
isReadOnly: false,
|
|
178
|
-
isRequired: false
|
|
179
|
-
};
|
|
180
131
|
export default DatePicker;
|
|
@@ -102,7 +102,9 @@ export default {
|
|
|
102
102
|
isReadOnly: false,
|
|
103
103
|
isRequired: false,
|
|
104
104
|
label: 'Example Label',
|
|
105
|
-
onChange: function onChange() {
|
|
105
|
+
onChange: function onChange() {
|
|
106
|
+
return undefined;
|
|
107
|
+
},
|
|
106
108
|
'aria-label': 'Date Picker'
|
|
107
109
|
}
|
|
108
110
|
};
|
|
@@ -132,7 +134,7 @@ export var Controlled = function Controlled(args) {
|
|
|
132
134
|
date = _useState2[0],
|
|
133
135
|
setDate = _useState2[1];
|
|
134
136
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DatePicker, _extends({}, args, {
|
|
135
|
-
value: date,
|
|
137
|
+
value: date !== null && date !== void 0 ? date : undefined,
|
|
136
138
|
onChange: chain(setDate, actions('onChange'))
|
|
137
139
|
})), ___EmotionJSX(Box, {
|
|
138
140
|
isRow: true,
|
|
@@ -12,7 +12,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
12
12
|
import { defaultFocus, input } from '../Input/Input.styles';
|
|
13
13
|
var inSlotContainer = _objectSpread(_objectSpread({}, input.fieldControlWrapper), {}, {
|
|
14
14
|
position: 'relative',
|
|
15
|
-
width: '
|
|
15
|
+
// Override the parent fieldContainer's '> .is-default { width: 100% }' rule
|
|
16
|
+
// because it has higher specificity.
|
|
17
|
+
width: 'fit-content !important'
|
|
16
18
|
});
|
|
17
19
|
var inputField = _objectSpread(_objectSpread({}, input), {}, {
|
|
18
20
|
width: 'auto',
|
|
@@ -223,9 +223,9 @@ test('should be able to select dates', /*#__PURE__*/_asyncToGenerator(/*#__PURE_
|
|
|
223
223
|
year = inputButtons[0];
|
|
224
224
|
month = inputButtons[1];
|
|
225
225
|
day = inputButtons[2];
|
|
226
|
-
expect(month).toHaveTextContent(8);
|
|
227
|
-
expect(day).toHaveTextContent(1);
|
|
228
|
-
expect(year).toHaveTextContent(2022);
|
|
226
|
+
expect(month).toHaveTextContent('8');
|
|
227
|
+
expect(day).toHaveTextContent('1');
|
|
228
|
+
expect(year).toHaveTextContent('2022');
|
|
229
229
|
expect(screen.queryByTestId('date-field')).toHaveValue('2022-08-01');
|
|
230
230
|
case 18:
|
|
231
231
|
case "end":
|
|
@@ -376,7 +376,7 @@ test('date picker with controlled value to change default value and clear any se
|
|
|
376
376
|
_context6.next = 16;
|
|
377
377
|
return userEvent.click(changeButton);
|
|
378
378
|
case 16:
|
|
379
|
-
expect(day).toHaveTextContent(10);
|
|
379
|
+
expect(day).toHaveTextContent('10');
|
|
380
380
|
_context6.next = 19;
|
|
381
381
|
return userEvent.click(clearButton);
|
|
382
382
|
case 19:
|
|
@@ -3,13 +3,11 @@ import _padStartInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
3
3
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import { useFocusManager } from 'react-aria';
|
|
5
5
|
import { useDateSegment } from '@react-aria/datepicker';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
6
|
import { Box } from '../../index';
|
|
8
|
-
|
|
7
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
9
8
|
/**
|
|
10
9
|
* Each editable segment of date.
|
|
11
10
|
*/
|
|
12
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
11
|
var DateSegment = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
12
|
var isLocalEnUS = props.isLocalEnUS,
|
|
15
13
|
segment = props.segment,
|
|
@@ -17,7 +15,7 @@ var DateSegment = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
17
15
|
handlePaste = props.handlePaste,
|
|
18
16
|
segments = props.segments,
|
|
19
17
|
segmentIndex = props.segmentIndex;
|
|
20
|
-
var segmentRef = useRef();
|
|
18
|
+
var segmentRef = useRef(null);
|
|
21
19
|
// istanbul ignore next
|
|
22
20
|
useImperativeHandle(ref, function () {
|
|
23
21
|
return segmentRef.current;
|
|
@@ -56,36 +54,25 @@ var DateSegment = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
56
54
|
}
|
|
57
55
|
return null;
|
|
58
56
|
}, [focusManager, segment, isPlaceholder]);
|
|
57
|
+
var displayText = text;
|
|
58
|
+
if (text === '/') {
|
|
59
|
+
displayText = '-';
|
|
60
|
+
} else {
|
|
61
|
+
var padLength = 0;
|
|
62
|
+
if (isLocalEnUS) {
|
|
63
|
+
if (type === 'year') {
|
|
64
|
+
padLength = 4;
|
|
65
|
+
} else {
|
|
66
|
+
padLength = 2;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
displayText = _padStartInstanceProperty(text).call(text, padLength, '0');
|
|
70
|
+
}
|
|
59
71
|
return ___EmotionJSX(Box, _extends({}, segmentProps, {
|
|
60
72
|
ref: segmentRef,
|
|
61
73
|
variant: "forms.datePicker.segment",
|
|
62
74
|
onKeyUp: handleKeyEvents,
|
|
63
75
|
onPaste: handlePaste
|
|
64
|
-
}),
|
|
76
|
+
}), displayText);
|
|
65
77
|
});
|
|
66
|
-
DateSegment.propTypes = {
|
|
67
|
-
/** slot for input that indicates each date segment */
|
|
68
|
-
segment: PropTypes.shape({
|
|
69
|
-
isPlaceholder: PropTypes.bool,
|
|
70
|
-
text: PropTypes.string,
|
|
71
|
-
placeholder: PropTypes.string,
|
|
72
|
-
value: PropTypes.number,
|
|
73
|
-
type: PropTypes.string
|
|
74
|
-
}),
|
|
75
|
-
/** index value of each segment */
|
|
76
|
-
segmentIndex: PropTypes.number,
|
|
77
|
-
/** An array of segments */
|
|
78
|
-
segments: PropTypes.arrayOf(PropTypes.shape({
|
|
79
|
-
text: PropTypes.string
|
|
80
|
-
})),
|
|
81
|
-
/** state returned by useDateField */
|
|
82
|
-
state: PropTypes.shape({}),
|
|
83
|
-
/**
|
|
84
|
-
* Handler that is called when a paste event is called.
|
|
85
|
-
* (e: PasteEvent) => void
|
|
86
|
-
*/
|
|
87
|
-
handlePaste: PropTypes.func,
|
|
88
|
-
/** checks if the current locale is en-US */
|
|
89
|
-
isLocalEnUS: PropTypes.bool
|
|
90
|
-
};
|
|
91
78
|
export default DateSegment;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["defaultPreviewImage", "defaultPreviewNode", "isImageType", "isLoading", "loaderSize", "isMenuOpen", "previewImage", "previewWidth", "widthHeightSx"];
|
|
4
|
-
import React, { forwardRef
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
5
|
import { mergeProps, useFocusRing } from 'react-aria';
|
|
6
6
|
import { useHover } from '@react-aria/interactions';
|
|
7
|
-
import
|
|
8
|
-
import { useGetTheme } from '../../hooks';
|
|
7
|
+
import { useGetTheme, useLocalOrForwardRef } from '../../hooks';
|
|
9
8
|
import { Box, Button, Icon, Image } from '../../index';
|
|
10
9
|
import Loader from '../Loader';
|
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -20,15 +19,11 @@ var ImagePreviewButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
19
|
previewWidth = props.previewWidth,
|
|
21
20
|
widthHeightSx = props.widthHeightSx,
|
|
22
21
|
others = _objectWithoutProperties(props, _excluded);
|
|
23
|
-
var buttonRef =
|
|
24
|
-
/* istanbul ignore next */
|
|
25
|
-
useImperativeHandle(ref, function () {
|
|
26
|
-
return buttonRef.current;
|
|
27
|
-
});
|
|
22
|
+
var buttonRef = useLocalOrForwardRef(ref);
|
|
28
23
|
var _useFocusRing = useFocusRing(),
|
|
29
24
|
focusProps = _useFocusRing.focusProps,
|
|
30
25
|
isFocusVisible = _useFocusRing.isFocusVisible;
|
|
31
|
-
var _useHover = useHover(
|
|
26
|
+
var _useHover = useHover({}),
|
|
32
27
|
hoverProps = _useHover.hoverProps,
|
|
33
28
|
isHovered = _useHover.isHovered;
|
|
34
29
|
var _useGetTheme = useGetTheme(),
|
|
@@ -86,7 +81,7 @@ var ImagePreviewButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
86
81
|
variant: "imageUpload.hoveredPreview.shaded"
|
|
87
82
|
}));
|
|
88
83
|
return ___EmotionJSX(Box, _extends({
|
|
89
|
-
|
|
84
|
+
tabIndex: 0,
|
|
90
85
|
sx: widthHeightSx
|
|
91
86
|
}, hoverProps), ___EmotionJSX(Button, _extends({
|
|
92
87
|
ref: buttonRef,
|
|
@@ -96,19 +91,5 @@ var ImagePreviewButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
96
91
|
"aria-label": "Image preview"
|
|
97
92
|
}, mergeProps(focusProps, others)), previewImage && isImageType ? imagePreview : noImagePreview, isLoading && loadingPreview, (isHovered || isFocusVisible) && !isLoading && hoveredPreview));
|
|
98
93
|
});
|
|
99
|
-
ImagePreviewButton.propTypes = {
|
|
100
|
-
defaultPreviewImage: PropTypes.string,
|
|
101
|
-
defaultPreviewNode: PropTypes.node,
|
|
102
|
-
isImageType: PropTypes.bool,
|
|
103
|
-
isLoading: PropTypes.bool,
|
|
104
|
-
isMenuOpen: PropTypes.bool,
|
|
105
|
-
loaderSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
106
|
-
previewImage: PropTypes.string,
|
|
107
|
-
previewWidth: PropTypes.number,
|
|
108
|
-
widthHeightSx: PropTypes.shape({
|
|
109
|
-
height: PropTypes.number,
|
|
110
|
-
width: PropTypes.number
|
|
111
|
-
})
|
|
112
|
-
};
|
|
113
94
|
ImagePreviewButton.displayName = 'ImagePreviewButton';
|
|
114
95
|
export default ImagePreviewButton;
|